Fix couple of bugs show-opcodes: lexer should not dump lines, serializer must not rewrite a single opcode when dumping

This commit is contained in:
Ilmir Usmanov
2014-07-31 21:09:42 +04:00
parent 0d1935e3a8
commit 14f0563d1a
4 changed files with 14 additions and 8 deletions
+3 -3
View File
@@ -33,7 +33,7 @@
#define MAX_NUMS 25
static const OPCODE *
parser_run (const char *script_source, size_t script_source_size __unused)
parser_run (const char *script_source, size_t script_source_size __unused, bool is_show_opcodes)
{
const char *strings[MAX_STRINGS];
int32_t nums[MAX_NUMS];
@@ -43,7 +43,7 @@ parser_run (const char *script_source, size_t script_source_size __unused)
TODO( Consider using script_source_size in lexer to check buffer boundaries );
lexer_init( script_source);
lexer_init( script_source, is_show_opcodes);
lexer_run_first_pass();
@@ -80,7 +80,7 @@ jerry_run (const char *script_source, size_t script_source_size, bool is_parse_o
serializer_init (is_show_opcodes);
opcodes = parser_run (script_source, script_source_size);
opcodes = parser_run (script_source, script_source_size, is_show_opcodes);
if (is_parse_only)
{