Skip to content

Commit b050e7b

Browse files
committed
Move bounds to the right by 'ssz' to account for the reversed branch instruction size
1 parent 4655409 commit b050e7b

File tree

2 files changed

+8683
-8676
lines changed

2 files changed

+8683
-8676
lines changed

src/coreclr/jit/emit.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5049,9 +5049,11 @@ void emitter::emitJumpDistBind()
50495049
nsd = B_DIST_SMALL_MAX_NEG;
50505050
psd = B_DIST_SMALL_MAX_POS;
50515051

5052+
// 2 instructions: "reverse cmp-and-branch; jal offset;"
5053+
// Move bounds to the right by 'ssz' to account for the reversed branch instruction size.
50525054
msz = sizeof(code_t) * 2;
5053-
nmd = J_DIST_SMALL_MAX_NEG;
5054-
pmd = J_DIST_SMALL_MAX_POS;
5055+
nmd = J_DIST_SMALL_MAX_NEG + ssz;
5056+
pmd = J_DIST_SMALL_MAX_POS + ssz;
50555057
}
50565058
else if (emitIsUncondJump(jmp))
50575059
{

0 commit comments

Comments
 (0)