Berry fix GC when lexer error

This commit is contained in:
Stephan Hadinger 2021-07-07 18:07:17 +02:00
parent 34346187e7
commit 3bd4358a37
2 changed files with 1 additions and 2 deletions

View File

@ -572,7 +572,6 @@ void be_lexer_deinit(blexer *lexer)
{
be_free(lexer->vm, lexer->buf.s, lexer->buf.size);
keyword_unregiste(lexer->vm);
be_stackpop(lexer->vm, 1); /* pop strtab */
}
int be_lexer_scan_next(blexer *lexer)

View File

@ -1520,7 +1520,7 @@ bclosure* be_parser_source(bvm *vm,
mainfunc(&parser, cl);
be_lexer_deinit(&parser.lexer);
be_global_release_space(vm); /* clear global space */
be_stackpop(vm, 1);
be_stackpop(vm, 2); /* pop strtab */
scan_next_token(&parser); /* clear lexer */
return cl;
}