Unshare popped TT_ENV objects.
MODIFY
src/vm.c
src/vm.c
@@ -1676,6 +1676,9 @@ RETRY_TRY_BLOCK:
ce = mrb->c->cibase + e->cioff;
while (--ci > ce) {
+ if (ci->env) {
+ mrb_env_unshare(mrb, ci->env);
+ }
if (ci->acc < 0) {
localjump_error(mrb, LOCALJUMP_ERROR_RETURN);
goto L_RAISE;
@@ -1727,6 +1730,9 @@ RETRY_TRY_BLOCK:
mrb->c->ci = ci;
break;
}
+ if (ci->env) {
+ mrb_env_unshare(mrb, ci->env);
+ }
ci--;
}
break;

Unshare popped TT_ENV objects.