NODE_FOR does not introduce new local variables

parent 4c69a9d0
...@@ -549,7 +549,7 @@ for_body(codegen_scope *s, node *tree) ...@@ -549,7 +549,7 @@ for_body(codegen_scope *s, node *tree)
/* generate receiver */ /* generate receiver */
codegen(s, tree->cdr->car, VAL); codegen(s, tree->cdr->car, VAL);
/* generate loop-block */ /* generate loop-block */
s = scope_new(s->mrb, s, tree->car); s = scope_new(s->mrb, s, NULL);
lp = loop_push(s, LOOP_FOR); lp = loop_push(s, LOOP_FOR);
lp->pc1 = new_label(s); lp->pc1 = new_label(s);
...@@ -2651,7 +2651,7 @@ print_r(mrb_state *mrb, mrb_irep *irep, size_t n, int pre) ...@@ -2651,7 +2651,7 @@ print_r(mrb_state *mrb, mrb_irep *irep, size_t n, int pre)
if (n == 0) return 0; if (n == 0) return 0;
for (i=0; i<irep->nlocals; i++) { for (i=0; i+1<irep->nlocals; i++) {
if (irep->lv[i].r == n) { if (irep->lv[i].r == n) {
mrb_sym sym = irep->lv[i].name; mrb_sym sym = irep->lv[i].name;
if (pre) printf(" "); if (pre) printf(" ");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment