Fix flags checking for GT_IND (#85890)
authorSingleAccretion <62474226+SingleAccretion@users.noreply.github.com>
Sun, 7 May 2023 21:13:44 +0000 (00:13 +0300)
committerGitHub <noreply@github.com>
Sun, 7 May 2023 21:13:44 +0000 (23:13 +0200)
src/coreclr/jit/gentree.cpp

index 654c5a5..676f6fa 100644 (file)
@@ -2671,6 +2671,20 @@ AGAIN:
 
     if (kind & GTK_UNOP)
     {
+        if (oper == GT_IND)
+        {
+            if (op1->TypeIs(TYP_STRUCT))
+            {
+                // Rare case -- need contextual information to check equality in some cases.
+                return false;
+            }
+
+            if ((op1->gtFlags & GTF_IND_FLAGS) != (op2->gtFlags & GTF_IND_FLAGS))
+            {
+                return false;
+            }
+        }
+
         if (IsExOp(kind))
         {
             // ExOp operators extend unary operator with extra, non-GenTree* members.  In many cases,
@@ -2725,20 +2739,6 @@ AGAIN:
 
                     break;
 
-                case GT_IND:
-                case GT_NULLCHECK:
-                    if (op1->TypeIs(TYP_STRUCT))
-                    {
-                        // Rare case -- need contextual information to check equality in some cases.
-                        return false;
-                    }
-
-                    if ((op1->gtFlags & GTF_IND_FLAGS) != (op2->gtFlags & GTF_IND_FLAGS))
-                    {
-                        return false;
-                    }
-                    break;
-
                 case GT_FIELD_ADDR:
                     if (op1->AsFieldAddr()->gtFldHnd != op2->AsFieldAddr()->gtFldHnd)
                     {