diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2014-08-13 23:58:32 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2014-08-13 23:58:32 +0900 |
| commit | 6c1dfc95669ca6c39685184c58760acc9f799d64 (patch) | |
| tree | 1f9b2b981a5fdb35a51b759ac9a341ce255c07b0 /src/proc.c | |
| parent | 2b9e5e751b4d6d1a86eb25b2a4e40f9c8d19c06c (diff) | |
| download | mruby-6c1dfc95669ca6c39685184c58760acc9f799d64.tar.gz mruby-6c1dfc95669ca6c39685184c58760acc9f799d64.zip | |
need to add space for receiver to proc env; fix #2525
Diffstat (limited to 'src/proc.c')
| -rw-r--r-- | src/proc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/proc.c b/src/proc.c index 0640e8614..0b776ea80 100644 --- a/src/proc.c +++ b/src/proc.c @@ -41,7 +41,7 @@ closure_setup(mrb_state *mrb, struct RProc *p, int nlocals) if (!mrb->c->ci->env) { e = (struct REnv*)mrb_obj_alloc(mrb, MRB_TT_ENV, (struct RClass*)mrb->c->ci->proc->env); - MRB_ENV_STACK_LEN(e)= (unsigned int)nlocals; + MRB_ENV_STACK_LEN(e) = (unsigned int)nlocals+1; /* add space for receiver */ e->mid = mrb->c->ci->mid; e->cioff = mrb->c->ci - mrb->c->cibase; e->stack = mrb->c->stack; |
