diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2016-11-23 20:50:14 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2016-11-23 20:50:14 +0900 |
| commit | bfbc6b9ea48355785c236826e3a1a217b668aee2 (patch) | |
| tree | 96206e78b8a38bc429b427f5c35736710943c5f4 /src/kernel.c | |
| parent | efebbbbf260e8ac5b8efbd0d4336a777cfeac514 (diff) | |
| download | mruby-bfbc6b9ea48355785c236826e3a1a217b668aee2.tar.gz mruby-bfbc6b9ea48355785c236826e3a1a217b668aee2.zip | |
local_variables() should not touch unshared env
Diffstat (limited to 'src/kernel.c')
| -rw-r--r-- | src/kernel.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/kernel.c b/src/kernel.c index 8b1ef80a0..74254e636 100644 --- a/src/kernel.c +++ b/src/kernel.c @@ -1078,7 +1078,8 @@ mrb_local_variables(mrb_state *mrb, mrb_value self) struct REnv *e = proc->env; while (e) { - if (!MRB_PROC_CFUNC_P(mrb->c->cibase[e->cioff].proc)) { + if (MRB_ENV_STACK_SHARED_P(e) && + !MRB_PROC_CFUNC_P(mrb->c->cibase[e->cioff].proc)) { irep = mrb->c->cibase[e->cioff].proc->body.irep; if (irep->lv) { for (i = 0; i + 1 < irep->nlocals; ++i) { |
