Skip to content

Commit

Permalink
YJIT: Assert Opnd::Stack's SP expectation (#10061)
Browse files Browse the repository at this point in the history
  • Loading branch information
k0kubun committed Feb 21, 2024
1 parent 5f00b2d commit 35f68e7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions yjit/src/backend/ir.rs
Expand Up @@ -1086,6 +1086,12 @@ impl Assembler
}
// Set current ctx.reg_temps to Opnd::Stack.
Opnd::Stack { idx, num_bits, stack_size, sp_offset, reg_temps: None } => {
assert_eq!(
self.ctx.get_stack_size() as i16 - self.ctx.get_sp_offset() as i16,
*stack_size as i16 - *sp_offset as i16,
"Opnd::Stack (stack_size: {}, sp_offset: {}) expects a different SP position from asm.ctx (stack_size: {}, sp_offset: {})",
*stack_size, *sp_offset, self.ctx.get_stack_size(), self.ctx.get_sp_offset(),
);
*opnd = Opnd::Stack {
idx: *idx,
num_bits: *num_bits,
Expand Down

0 comments on commit 35f68e7

Please sign in to comment.