summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vm.c2
-rw-r--r--yjit/src/codegen.rs6
2 files changed, 6 insertions, 2 deletions
diff --git a/vm.c b/vm.c
index 31725ae2d0..69d57913a4 100644
--- a/vm.c
+++ b/vm.c
@@ -1609,7 +1609,7 @@ rb_vm_invoke_proc_with_self(rb_execution_context_t *ec, rb_proc_t *proc, VALUE s
VALUE *
rb_vm_svar_lep(const rb_execution_context_t *ec, const rb_control_frame_t *cfp)
{
- while (cfp->pc == 0) {
+ while (cfp->pc == 0 || cfp->iseq == 0) {
if (VM_FRAME_TYPE(cfp) == VM_FRAME_MAGIC_IFUNC) {
struct vm_ifunc *ifunc = (struct vm_ifunc *)cfp->iseq;
return ifunc->svar_lep;
diff --git a/yjit/src/codegen.rs b/yjit/src/codegen.rs
index 577031c86e..2ea64871b3 100644
--- a/yjit/src/codegen.rs
+++ b/yjit/src/codegen.rs
@@ -5095,7 +5095,11 @@ fn gen_send_cfunc(
cme,
recv,
sp,
- pc: Some(0),
+ pc: if cfg!(debug_assertions) {
+ Some(!0) // Poison value. Helps to fail fast.
+ } else {
+ None // Leave PC uninitialized as cfuncs shouldn't read it
+ },
iseq: None,
local_size: 0,
});