Skip to content

Commit d2b3c6e

Browse files
tenderlovek0kubun
andauthored
Update zjit/src/backend/lir.rs
Co-authored-by: Takashi Kokubun <[email protected]>
1 parent c42d9a6 commit d2b3c6e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

zjit/src/backend/lir.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1751,7 +1751,9 @@ impl Assembler
17511751
self.expand_branch_insn(insn, &mut insns);
17521752
}
17531753

1754-
// If the last instruction of the block is a ret, add a pad patch point after it
1754+
// If the last instruction of the block is a ret, add a pad patch point after it.
1755+
// Otherwise, because a jump may be longer than a ret, a PatchPoint right before
1756+
// a ret may overwrite the next block.
17551757
if let Some(last_insn) = block.insns.last() {
17561758
if matches!(last_insn, Insn::CRet(_)) {
17571759
insns.push(Insn::PadPatchPoint);

0 commit comments

Comments
 (0)