Type `lea [this + delegateObject]` as `TYP_BYREF`.
authorPat Gavlin <pagavlin@microsoft.com>
Wed, 23 Aug 2017 20:31:39 +0000 (13:31 -0700)
committerPat Gavlin <pagavlin@microsoft.com>
Wed, 23 Aug 2017 20:31:39 +0000 (13:31 -0700)
This node was incorrectly typed as `TYP_GCREF`, which was causing an
assertion during GC stress in internal testing.

Fixes VSO 482577.

Commit migrated from https://github.com/dotnet/coreclr/commit/6025fd00f0c86359817d5b09470120c177e4a124

src/coreclr/src/jit/lower.cpp

index 1b1df60..d137297 100644 (file)
@@ -2795,7 +2795,7 @@ GenTree* Lowering::LowerDelegateInvoke(GenTreeCall* call)
     // [originalThis + offsetOfDelegateInstance]
 
     GenTree* newThisAddr = new (comp, GT_LEA)
-        GenTreeAddrMode(TYP_REF, thisExpr, nullptr, 0, comp->eeGetEEInfo()->offsetOfDelegateInstance);
+        GenTreeAddrMode(TYP_BYREF, thisExpr, nullptr, 0, comp->eeGetEEInfo()->offsetOfDelegateInstance);
 
     GenTree* newThis = comp->gtNewOperNode(GT_IND, TYP_REF, newThisAddr);