summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/eval.c b/eval.c
index 8390c7dc31..dc5af43928 100644
--- a/eval.c
+++ b/eval.c
@@ -1030,6 +1030,19 @@ prev_frame_func(void)
return frame_func_id(prev_cfp);
}
+ID
+rb_frame_last_func(void)
+{
+ rb_thread_t *th = GET_THREAD();
+ rb_control_frame_t *cfp = th->cfp;
+ ID mid;
+
+ while (!(mid = frame_func_id(cfp)) &&
+ (cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp),
+ !RUBY_VM_CONTROL_FRAME_STACK_OVERFLOW_P(th, cfp)));
+ return mid;
+}
+
/*
* call-seq:
* append_features(mod) -> mod