Mark sizeValue as non faulting. (#41776)
authorSergey Andreenko <seandree@microsoft.com>
Thu, 3 Sep 2020 16:50:32 +0000 (09:50 -0700)
committerGitHub <noreply@github.com>
Thu, 3 Sep 2020 16:50:32 +0000 (09:50 -0700)
The address of the ind can't be null because it is a prejited location.

However, the value of the indirection could be different, so should not mark as invariant.

src/coreclr/src/jit/importer.cpp

index f03f639..0c0b67e 100644 (file)
@@ -2223,6 +2223,7 @@ GenTree* Compiler::impRuntimeLookupToTree(CORINFO_RESOLVED_TOKEN* pResolvedToken
         GenTreeIntCon* sizeOffset      = gtNewIconNode(pRuntimeLookup->sizeOffset, TYP_I_IMPL);
         GenTree*       sizeValueOffset = gtNewOperNode(GT_ADD, TYP_I_IMPL, lastIndOfTree, sizeOffset);
         GenTree*       sizeValue       = gtNewOperNode(GT_IND, TYP_I_IMPL, sizeValueOffset);
+        sizeValue->gtFlags |= GTF_IND_NONFAULTING;
 
         // sizeCheck fails if sizeValue < pRuntimeLookup->offsets[i]
         GenTree* offsetValue = gtNewIconNode(pRuntimeLookup->offsets[pRuntimeLookup->indirections - 1], TYP_I_IMPL);