From 140c27c56dddc48a14400f8e29b1a41f8a2daba5 Mon Sep 17 00:00:00 2001 From: Kyungwoo Lee Date: Mon, 14 Mar 2016 13:53:07 -0700 Subject: ARM64: Fix genJumpToThrowHlpBlk This is additional fix to https://github.com/dotnet/coreclr/issues/3667. When JIT invokes this API with direct jump (EJ_jmp), JIT also tries to circumvent the target by reversing the jump kind in debug path. In this case, actually we should directly invoke the target. Before (Fail) ``` b G_M36945_IG03 bl CORINFO_HELP_THROWDIVZERO G_M36945_IG03: ``` After (Pass) ``` bl CORINFO_HELP_THROWDIVZERO ``` --- src/jit/codegencommon.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'src/jit') diff --git a/src/jit/codegencommon.cpp b/src/jit/codegencommon.cpp index 9376666762..4edc613ec0 100644 --- a/src/jit/codegencommon.cpp +++ b/src/jit/codegencommon.cpp @@ -2674,15 +2674,22 @@ void CodeGen::genJumpToThrowHlpBlk(emitJumpKind jumpKind, /* The code to throw the exception will be generated inline, and we will jump around it in the normal non-exception case */ - BasicBlock * tgtBlk = genCreateTempLabel(); - jumpKind = emitter::emitReverseJumpKind(jumpKind); - inst_JMP(jumpKind, tgtBlk); + BasicBlock * tgtBlk = nullptr; + emitJumpKind reverseJumpKind = emitter::emitReverseJumpKind(jumpKind); + if (reverseJumpKind != jumpKind) + { + tgtBlk = genCreateTempLabel(); + inst_JMP(reverseJumpKind, tgtBlk); + } genEmitHelperCall(compiler->acdHelper(codeKind), 0, EA_UNKNOWN); /* Define the spot for the normal non-exception case to jump to */ - - genDefineTempLabel(tgtBlk); + if (tgtBlk != nullptr) + { + assert(reverseJumpKind != jumpKind); + genDefineTempLabel(tgtBlk); + } } } -- cgit v1.2.3