summaryrefslogtreecommitdiff
path: root/vm.c
diff options
context:
space:
mode:
Diffstat (limited to 'vm.c')
-rw-r--r--vm.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/vm.c b/vm.c
index e1c6298..947b181 100644
--- a/vm.c
+++ b/vm.c
@@ -930,6 +930,15 @@ rb_vm_cref(void)
return rb_vm_get_cref(cfp->iseq, cfp->ep);
}
+NODE *
+rb_vm_cref_in_context(VALUE self)
+{
+ rb_thread_t *th = GET_THREAD();
+ const rb_control_frame_t *cfp = rb_vm_get_ruby_level_next_cfp(th, th->cfp);
+ if (cfp->self != self) return NULL;
+ return rb_vm_get_cref(cfp->iseq, cfp->ep);
+}
+
#if 0
void
debug_cref(NODE *cref)