Skip to content

Commit

Permalink
Avoid unsharing stack if env refers top-level; ref #3643
Browse files Browse the repository at this point in the history
  • Loading branch information
matz committed May 25, 2017
1 parent e093112 commit f88cb88
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/vm.c
Expand Up @@ -264,6 +264,7 @@ mrb_env_unshare(mrb_state *mrb, struct REnv *e)
mrb_value *p; mrb_value *p;


if (!MRB_ENV_STACK_SHARED_P(e)) return; if (!MRB_ENV_STACK_SHARED_P(e)) return;
if (e->cioff == 0 && e->cxt.c == mrb->root_c) return;
MRB_ENV_UNSHARE_STACK(e); MRB_ENV_UNSHARE_STACK(e);
if (!e->c) { if (!e->c) {
/* save block argument position (negated) */ /* save block argument position (negated) */
Expand Down

0 comments on commit f88cb88

Please sign in to comment.