Fix for CoreRT issue Assertion slot != NO_REVERSE_PINVOKE_FRAME' failed dotnet/corecl...
authorSergey Ignatov <sergign60@mail.ru>
Thu, 11 Oct 2018 13:56:17 +0000 (16:56 +0300)
committerSergey Ignatov <sergign60@mail.ru>
Thu, 11 Oct 2018 13:56:17 +0000 (16:56 +0300)
Commit migrated from https://github.com/dotnet/coreclr/commit/ae02bf5ccc0ae881fe6c5e319c936e8d9fd3ba46

src/coreclr/src/jit/codegenarmarch.cpp

index ec31201..bba8c6a 100644 (file)
@@ -3140,6 +3140,14 @@ void CodeGen::genCreateAndStoreGCInfo(unsigned codeSize,
 
 #endif // _TARGET_ARM64_
 
+    if (compiler->opts.IsReversePInvoke())
+    {
+        unsigned reversePInvokeFrameVarNumber = compiler->lvaReversePInvokeFrameVar;
+        assert(reversePInvokeFrameVarNumber != BAD_VAR_NUM && reversePInvokeFrameVarNumber < compiler->lvaRefCount);
+        LclVarDsc& reversePInvokeFrameVar = compiler->lvaTable[reversePInvokeFrameVarNumber];
+        gcInfoEncoder->SetReversePInvokeFrameSlot(reversePInvokeFrameVar.lvStkOffs);
+    }
+
     gcInfoEncoder->Build();
 
     // GC Encoder automatically puts the GC info in the right spot using ICorJitInfo::allocGCInfo(size_t)