don't rewind local variables too far

This commit is contained in:
Wolfgang (Blub) Bumiller 2012-08-12 18:58:46 +02:00
parent 0c06f9f650
commit 437988c5b4

View file

@ -13,8 +13,6 @@ typedef struct {
lex_file *lex; lex_file *lex;
int tok; int tok;
int fieldsize;
MEM_VECTOR_MAKE(varentry_t, globals); MEM_VECTOR_MAKE(varentry_t, globals);
MEM_VECTOR_MAKE(varentry_t, fields); MEM_VECTOR_MAKE(varentry_t, fields);
MEM_VECTOR_MAKE(ast_function*, functions); MEM_VECTOR_MAKE(ast_function*, functions);
@ -952,10 +950,10 @@ static ast_block* parser_parse_block(parser_t *parser)
} }
cleanup: cleanup:
parser->blocklocal = oldblocklocal;
/* unroll the local vector */
while (parser->locals_count > parser->blocklocal) while (parser->locals_count > parser->blocklocal)
parser_pop_local(parser); parser_pop_local(parser);
parser->blocklocal = oldblocklocal;
/* unroll the local vector */
return block; return block;
} }