summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2018-02-09 12:34:54 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2018-02-09 12:34:54 +0900
commitb43c146455d16695d0b5bf70448e5470fe560639 (patch)
tree30b830b4044f74b678f8989b78c321647573389d /src
parent4c18e37f71eff6af3e27deac544a41c439a2c2ff (diff)
downloadmruby-b43c146455d16695d0b5bf70448e5470fe560639.tar.gz
mruby-b43c146455d16695d0b5bf70448e5470fe560639.zip
Check `ensure` proc is NULL before calling; fix #3943
Diffstat (limited to 'src')
-rw-r--r--src/vm.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/vm.c b/src/vm.c
index 1f47eb99c..330bcd024 100644
--- a/src/vm.c
+++ b/src/vm.c
@@ -1351,6 +1351,7 @@ RETRY_TRY_BLOCK:
for (n=0; n<a; n++) {
proc = mrb->c->ensure[epos+n];
mrb->c->ensure[epos+n] = NULL;
+ if (proc == NULL) continue;
irep = proc->body.irep;
ci = cipush(mrb);
ci->mid = ci[-1].mid;