diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-05-25 14:13:16 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-05-25 14:13:16 +0900 |
| commit | f88cb8807343c91c2fbad486aa6b09ccee0b9643 (patch) | |
| tree | 9c9ab0a643e821fbe443725ac27d70eed280da75 | |
| parent | e0931126ffcfd13af42c0a7ce4a37cc73f4223da (diff) | |
| download | mruby-f88cb8807343c91c2fbad486aa6b09ccee0b9643.tar.gz mruby-f88cb8807343c91c2fbad486aa6b09ccee0b9643.zip | |
Avoid unsharing stack if env refers top-level; ref #3643
| -rw-r--r-- | src/vm.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -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->cioff == 0 && e->cxt.c == mrb->root_c) return; MRB_ENV_UNSHARE_STACK(e); if (!e->c) { /* save block argument position (negated) */ |
