diff options
| -rw-r--r-- | main.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -130,7 +130,6 @@ void parse_stmt(Lexer *l, Proc *p); void parse_block(Lexer *l, Proc *p) { Graph *g = &p->graph; lex_next(l); - arena_reset(&p->scratch); scope_push(&p->scope); while (l->tok != TOK_RBRACE) { lex_expected_not(l, TM_EOF); @@ -330,7 +329,7 @@ void parse_if(Lexer *l, Proc *p) { assert(region->in.data[0]); assert(region->in.data[1]); - scope_changelist_merge(&p->scope, &chg_if, &chg_else, region, g, &p->scratch); + scope_changelist_merge(&p->scope, l, &chg_if, &chg_else, region, g, &p->scratch); scope_changelist_discard(&chg_if, g); scope_changelist_discard(&chg_else, g); node_del_out(region, g->keepalive); @@ -499,6 +498,7 @@ Proc *parse_proc(Lexer *l, Unit *u) { while (l->tok != TOK_RBRACE) { lex_expected_not(l, TM_EOF); parse_stmt(l, proc); + arena_reset(&proc->scratch); } scope_pop(&proc->scope, &proc->graph); lex_expected(l, TM_RBRACE); |
