summaryrefslogtreecommitdiff
path: root/yjit
diff options
context:
space:
mode:
Diffstat (limited to 'yjit')
-rw-r--r--yjit/src/core.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/yjit/src/core.rs b/yjit/src/core.rs
index 102988db11..66c1df083f 100644
--- a/yjit/src/core.rs
+++ b/yjit/src/core.rs
@@ -1647,9 +1647,12 @@ fn branch_stub_hit_body(branch_ptr: *const c_void, target_idx: u32, ec: EcPtr) -
let cfp = get_ec_cfp(ec);
let original_interp_sp = get_cfp_sp(cfp);
- let reconned_pc = rb_iseq_pc_at_idx(rb_cfp_get_iseq(cfp), target.idx);
+ let running_iseq = rb_cfp_get_iseq(cfp);
+ let reconned_pc = rb_iseq_pc_at_idx(running_iseq, target.idx);
let reconned_sp = original_interp_sp.offset(target_ctx.sp_offset.into());
+ assert_eq!(running_iseq, target.iseq as _, "each stub expects a particular iseq");
+
// Update the PC in the current CFP, because it may be out of sync in JITted code
rb_set_cfp_pc(cfp, reconned_pc);