From 97d07aec271e4e0f0f0127fbbf2240eb5b951c9b Mon Sep 17 00:00:00 2001 From: Jonghyun Park Date: Fri, 21 Apr 2017 14:42:25 +0900 Subject: [PATCH] [x86/Linux] Relax inst_JMP assert condition (#11062) * [x86/Linux] Do NOT use exception-throwing block on ESP framed method * Fix format error * Relax assert condition * Fix format error * Revert changes in codegencommon.cpp * Add parentheses --- src/jit/instr.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/jit/instr.cpp b/src/jit/instr.cpp index e2435ca..5bbfdde 100644 --- a/src/jit/instr.cpp +++ b/src/jit/instr.cpp @@ -244,8 +244,15 @@ void CodeGen::inst_JMP(emitJumpKind jmp, BasicBlock* tgtBlock) // // Thus only on x86 do we need to assert that the stack level at the target block matches the current stack level. // - assert(tgtBlock->bbTgtStkDepth * sizeof(int) == genStackLevel || compiler->rpFrameType != FT_ESP_FRAME); + CLANG_FORMAT_COMMENT_ANCHOR; + +#ifdef UNIX_X86_ABI + // bbTgtStkDepth is a (pure) argument count (stack alignment padding should be excluded). + assert((tgtBlock->bbTgtStkDepth * sizeof(int) == (genStackLevel - curNestedAlignment)) || isFramePointerUsed()); +#else + assert((tgtBlock->bbTgtStkDepth * sizeof(int) == genStackLevel) || isFramePointerUsed()); #endif +#endif // !FEATURE_FIXED_OUT_ARGS getEmitter()->emitIns_J(emitter::emitJumpKindToIns(jmp), tgtBlock); } -- 2.7.4