summaryrefslogtreecommitdiff
path: root/vm_insnhelper.c
diff options
context:
space:
mode:
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r--vm_insnhelper.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index bd03c69395..366ac4a467 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -1410,9 +1410,14 @@ vm_search_superclass(rb_control_frame_t *reg_cfp, rb_iseq_t *iseq,
}
while (lcfp->iseq != iseq) {
+ rb_thread_t *th = GET_THREAD();
VALUE *tdfp = GET_PREV_DFP(lcfp->dfp);
while (1) {
lcfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(lcfp);
+ if (RUBY_VM_CONTROL_FRAME_STACK_OVERFLOW_P(th, lcfp)) {
+ rb_raise(rb_eNoMethodError,
+ "super called outside of method");
+ }
if (lcfp->dfp == tdfp) {
break;
}