Require a frame pointer in methods with throw blocks for sources that have mismatched...
authorPat Gavlin <pagavlin@microsoft.com>
Wed, 26 Apr 2017 20:23:59 +0000 (13:23 -0700)
committerPat Gavlin <pagavlin@microsoft.com>
Wed, 26 Apr 2017 20:23:59 +0000 (13:23 -0700)
This requirement effectively disables double-aligned frames (which are
effectively a special case of ESP frames). Without this change it is
possible for the JIT to generate a throw block with sources that have
mismatched offsets, which can lead to GC holes.

Fixes VSO 424019.

src/jit/flowgraph.cpp

index 0307ef8..71e9f66 100644 (file)
@@ -17733,10 +17733,12 @@ BasicBlock* Compiler::fgAddCodeRef(BasicBlock* srcBlk, unsigned refData, Special
 
 #if defined(UNIX_X86_ABI)
         codeGen->setFrameRequired(true);
+        codeGen->setFramePointerRequiredGCInfo(true);
 #else  // !defined(UNIX_X86_ABI)
         if (add->acdStkLvl != stkDepth)
         {
             codeGen->setFrameRequired(true);
+            codeGen->setFramePointerRequiredGCInfo(true);
         }
 #endif // !defined(UNIX_X86_ABI)
 #endif // _TARGET_X86_