Skip to content

Commit

Permalink
YJIT: Assert that lea is only used with a mem operand
Browse files Browse the repository at this point in the history
  • Loading branch information
XrXr committed Jan 25, 2024
1 parent e452caa commit d0c1188
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions yjit/src/asm/x86_64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -952,6 +952,7 @@ pub fn jmp32(cb: &mut CodeBlock, offset: i32) {
pub fn lea(cb: &mut CodeBlock, dst: X86Opnd, src: X86Opnd) {
if let X86Opnd::Reg(reg) = dst {
assert!(reg.num_bits == 64);
assert!(matches!(src, X86Opnd::Mem(_)));
write_rm(cb, false, true, dst, src, None, &[0x8d]);
} else {
unreachable!();
Expand Down

0 comments on commit d0c1188

Please sign in to comment.