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 0bd29b5208..3b442c8d9e 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -1402,6 +1402,11 @@ vm_search_superclass(rb_control_frame_t *reg_cfp, rb_iseq_t *ip,
}
}
+ /* temporary measure for [Bug #2420] [Bug #3136] */
+ if (!lcfp->me) {
+ rb_raise(rb_eNoMethodError, "super called outside of method");
+ }
+
id = lcfp->me->def->original_id;
klass = vm_search_normal_superclass(lcfp->me->klass, recv);
}