Permalink
Browse files

Avoid unsharing env when context (mrb->c) differs; ref #3668

  • Loading branch information...
matz committed May 27, 2017
1 parent 54b45f6 commit 57ffa1c1508f01434806b1b7301f4ae982eb9ae0
Showing with 1 addition and 0 deletions.
  1. +1 −0 src/vm.c
View
@@ -264,6 +264,7 @@ mrb_env_unshare(mrb_state *mrb, struct REnv *e)
mrb_value *p;
if (!MRB_ENV_STACK_SHARED_P(e)) return;
if (e->cxt.c != mrb->c) return;
if (e->cioff == 0 && e->cxt.c == mrb->root_c) return;
MRB_ENV_UNSHARE_STACK(e);
if (!e->c) {

0 comments on commit 57ffa1c

Please sign in to comment.