Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
keep stack with nlocals instead of nregs; fix #1706
  • Loading branch information
flaneur2020 committed Feb 14, 2014
1 parent ba8a8e7 commit 9ebfeac
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions mrbgems/mruby-bin-mirb/tools/mirb/mirb.c
Expand Up @@ -251,8 +251,7 @@ main(int argc, char **argv)
int n;
mrb_bool code_block_open = FALSE;
int ai;
mrb_bool first_command = TRUE;
unsigned int nregs;
unsigned int stack_keep = 0;

/* new interpreter instance */
mrb = mrb_open();
Expand Down Expand Up @@ -365,12 +364,12 @@ main(int argc, char **argv)
mrb_codedump_all(mrb, proc);
}
/* pass a proc for evaulation */
nregs = first_command ? 0: proc->body.irep->nregs;
/* evaluate the bytecode */
result = mrb_context_run(mrb,
proc,
mrb_top_self(mrb),
nregs);
stack_keep);
stack_keep = proc->body.irep->nlocals;
/* did an exception occur? */
if (mrb->exc) {
p(mrb, mrb_obj_value(mrb->exc), 0);
Expand All @@ -390,7 +389,6 @@ main(int argc, char **argv)
}
mrb_parser_free(parser);
cxt->lineno++;
first_command = FALSE;
}
mrbc_context_free(mrb, cxt);
mrb_close(mrb);
Expand Down

0 comments on commit 9ebfeac

Please sign in to comment.