[interp] Add assert in jmp that sp == stack at start. (mono/mono#16788)
authorJay Krell <jaykrell@microsoft.com>
Thu, 12 Sep 2019 12:06:31 +0000 (05:06 -0700)
committerVlad Brezae <brezaevlad@gmail.com>
Thu, 12 Sep 2019 12:06:31 +0000 (15:06 +0300)
It makes it true sometimes, only if not calling alloca.
Throwing invalid IL if false might be preferred here.

Commit migrated from https://github.com/mono/mono/commit/c7df01524a1dd6ef713bb074c199bae908532b9b

src/mono/mono/mini/interp/interp.c

index 13017ef..95247db 100644 (file)
@@ -3435,6 +3435,7 @@ main_loop:
                        MINT_IN_BREAK;
                }
                MINT_IN_CASE(MINT_JMP) {
+                       g_assert (sp == frame->stack);
                        InterpMethod *new_method = (InterpMethod*)frame->imethod->data_items [ip [1]];
 
                        if (frame->imethod->prof_flags & MONO_PROFILER_CALL_INSTRUMENTATION_TAIL_CALL)