summaryrefslogtreecommitdiff
path: root/yjit
diff options
context:
space:
mode:
authorAaron Patterson <tenderlove@ruby-lang.org>2022-05-12 12:08:35 -0700
committerGitHub <noreply@github.com>2022-05-12 12:08:35 -0700
commitf07a0e79a225190e3c51d9306af3f8c515e8e41f (patch)
treee8f9a5ce7a911fec991f59404d8343e4b2d4f288 /yjit
parent75223433512d46f94fba5c0cb6f585fff5e9eee7 (diff)
YJIT: Fix getting the EP with registers other than RAX (#5882)
Before this commit we were accidentally clobbering RAX. Additionally, since this function had RAX hardcoded then the function may not have worked with registers other than RAX. Co-authored-by: John Hawthorn <john@hawthorn.email>
Notes
Notes: Merged-By: jhawthorn <john@hawthorn.email>
Diffstat (limited to 'yjit')
-rw-r--r--yjit/src/codegen.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/yjit/src/codegen.rs b/yjit/src/codegen.rs
index d4aee9528e..60d8551a57 100644
--- a/yjit/src/codegen.rs
+++ b/yjit/src/codegen.rs
@@ -1477,7 +1477,7 @@ fn gen_get_ep(cb: &mut CodeBlock, reg: X86Opnd, level: u32) {
// See GET_PREV_EP(ep) macro
// VALUE *prev_ep = ((VALUE *)((ep)[VM_ENV_DATA_INDEX_SPECVAL] & ~0x03))
let offs = (SIZEOF_VALUE as i32) * (VM_ENV_DATA_INDEX_SPECVAL as i32);
- mov(cb, reg, mem_opnd(64, REG0, offs));
+ mov(cb, reg, mem_opnd(64, reg, offs));
and(cb, reg, imm_opnd(!0x03));
}
}