mirror of
https://github.com/jerryscript-project/jerryscript.git
synced 2025-12-15 16:29:21 +00:00
Fix some bugs in lexer
This commit is contained in:
parent
dd5f90d50f
commit
d15cf8f436
@ -56,7 +56,7 @@ static const char *token_start;
|
||||
static char
|
||||
get_char (size_t i)
|
||||
{
|
||||
JERRY_ASSERT (i < buffer_size);
|
||||
JERRY_ASSERT ((buffer + i) < (buffer_start + buffer_size));
|
||||
return *(buffer + i);
|
||||
}
|
||||
|
||||
@ -950,4 +950,6 @@ void
|
||||
lexer_free (void)
|
||||
{
|
||||
mem_heap_free_block ((uint8_t *) strings_cache);
|
||||
strings_cache = NULL;
|
||||
strings_cache_size = 0;
|
||||
}
|
||||
|
||||
@ -52,11 +52,11 @@ parser_run (const char *script_source, size_t script_source_size, bool is_show_o
|
||||
offset = serializer_dump_strings (strings, strings_num);
|
||||
serializer_dump_nums (nums, nums_count, offset, strings_num);
|
||||
|
||||
lexer_free ();
|
||||
|
||||
parser_init ();
|
||||
parser_parse_program ();
|
||||
|
||||
lexer_free ();
|
||||
|
||||
opcodes = deserialize_bytecode ();
|
||||
|
||||
optimizer_run_passes ((OPCODE *) opcodes);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user