summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2017-08-19 11:39:42 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2017-08-19 11:39:42 +0900
commitdb098d3e0ef05372f6f08cdc3332790f0f65dcf1 (patch)
treede5b89dbb3ab45122e7ef8a70653648ac7b159c7
parent2294ebdd44aa28d97d82a3695f56e80f6014e685 (diff)
downloadmruby-db098d3e0ef05372f6f08cdc3332790f0f65dcf1.tar.gz
mruby-db098d3e0ef05372f6f08cdc3332790f0f65dcf1.zip
Type check before traversing `irep->outer`; fix #3782
-rw-r--r--src/variable.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/variable.c b/src/variable.c
index 7395f23c7..a8bba8b80 100644
--- a/src/variable.c
+++ b/src/variable.c
@@ -853,7 +853,7 @@ mrb_vm_const_get(mrb_state *mrb, mrb_sym sym)
if (c2->tt == MRB_TT_CLASS || c2->tt == MRB_TT_MODULE) c = c2;
mrb_assert(!MRB_PROC_CFUNC_P(mrb->c->ci->proc));
proc = mrb->c->ci->proc->body.irep->outer;
- while (proc) {
+ while (proc && proc->tt == MRB_TT_PROC) {
mrb_assert(!MRB_PROC_CFUNC_P(proc));
if (MRB_PROC_CLASS_P(proc) && proc->target_class) {
c2 = proc->target_class;