Skip to content

Commit

Permalink
Fix bug with LeaLabel on x86, add CI test
Browse files Browse the repository at this point in the history
  • Loading branch information
maximecb authored and k0kubun committed Aug 25, 2022
1 parent b9e91f9 commit 813a8ff
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/yjit-new-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ jobs:
# Try booting miniruby
- run: RUST_BACKTRACE=1 ./miniruby --yjit-call-threshold=1 -e0

# Check that --yjit-dump-insns works correctly
- run: RUST_BACKTRACE=1 ./miniruby --yjit-call-threshold=1 --yjit-dump-insns -e0

# Try outputting stats (should be available in dev config)
#- run: RUST_BACKTRACE=1 ./miniruby --yjit-call-threshold=1 --yjit-stats -e0

Expand Down
4 changes: 2 additions & 2 deletions yjit/src/backend/x86_64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,15 +262,15 @@ impl Assembler
Op::LeaLabel => {
let label_idx = insn.target.unwrap().unwrap_label_idx();

cb.label_ref(label_idx, 4, |cb, src_addr, dst_addr| {
cb.label_ref(label_idx, 7, |cb, src_addr, dst_addr| {
let disp = dst_addr - src_addr;
lea(cb, Self::SCRATCH0, mem_opnd(8, RIP, disp.try_into().unwrap()));
});

mov(cb, insn.out.into(), Self::SCRATCH0);
},

// Push and pop to the C stack
// Push and pop to/from the C stack
Op::CPush => push(cb, insn.opnds[0].into()),
Op::CPop => pop(cb, insn.out.into()),
Op::CPopInto => pop(cb, insn.opnds[0].into()),
Expand Down

0 comments on commit 813a8ff

Please sign in to comment.