Skip to content

Commit 6a66ce1

Browse files
committed
Need to unshare env from top callinfo; fix #3685
1 parent ebd6636 commit 6a66ce1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/vm.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -1872,14 +1872,15 @@ mrb_vm_exec(mrb_state *mrb, struct RProc *proc, mrb_code *pc)
18721872
}
18731873

18741874
ce = mrb->c->cibase + e->cioff;
1875-
while (--ci > ce) {
1875+
while (ci >= ce) {
18761876
if (ci->env) {
18771877
mrb_env_unshare(mrb, ci->env);
18781878
}
18791879
if (ci->acc < 0) {
18801880
localjump_error(mrb, LOCALJUMP_ERROR_RETURN);
18811881
goto L_RAISE;
18821882
}
1883+
ci--;
18831884
}
18841885
if (ce == mrb->c->cibase) {
18851886
localjump_error(mrb, LOCALJUMP_ERROR_RETURN);

0 commit comments

Comments
 (0)