Fix missing setting of ScanContext::stack_limit
authorJan Vorlicek <janvorli@microsoft.com>
Fri, 22 Jan 2016 16:07:26 +0000 (17:07 +0100)
committerJan Vorlicek <janvorli@microsoft.com>
Fri, 22 Jan 2016 16:07:26 +0000 (17:07 +0100)
There is a code path executed when the GCStress is on and that was missing setting the stack_limit
value that the PromoteCarefully uses to detect objects on the stack.

src/vm/frames.cpp

index fd72903..b2a9ebf 100644 (file)
@@ -1466,6 +1466,8 @@ BOOL TransitionFrame::Protects(OBJECTREF * ppORef)
 {
     WRAPPER_NO_CONTRACT;
     IsObjRefProtectedScanContext sc (ppORef);
+    // Set the stack limit for the scan to the SP of the managed frame above the transition frame
+    sc.stack_limit = GetSP();
     GcScanRoots (IsObjRefProtected, &sc);
     return sc.oref_protected;
 }