Fix memory corruptions in lexer, which occured while parsing cse.js; remove lexer.log and parser.log files

This commit is contained in:
Ilmir Usmanov
2014-07-25 14:16:29 +04:00
parent c9c26251a4
commit 40007126fa
7 changed files with 26 additions and 50 deletions
+3 -10
View File
@@ -27,10 +27,6 @@ static OPCODE opcode;
static T_IDX opcode_counter = 0;
static T_IDX temp_name_stack[MAX_OPCODES], temp_name_stack_head = 0, max_temp_name;
#ifdef __HOST
_FILE *debug_file;
#endif
static T_IDX parse_expression (void);
static void parse_statement (void);
static T_IDX parse_assignment_expression (void);
@@ -147,13 +143,13 @@ insert_semicolon (void)
do { skip_newlines (); ID = parse_##TYPE (); } while (0)
#define DUMP_VOID_OPCODE(GETOP) \
do { opcode=getop_##GETOP (); serializer_dump_opcode (&opcode); opcode_counter++; } while (0)
do { opcode=getop_##GETOP (); serializer_dump_opcode (opcode); opcode_counter++; } while (0)
#define DUMP_OPCODE(GETOP, ...) \
do { opcode=getop_##GETOP (__VA_ARGS__); serializer_dump_opcode (&opcode); opcode_counter++; } while (0)
do { opcode=getop_##GETOP (__VA_ARGS__); serializer_dump_opcode (opcode); opcode_counter++; } while (0)
#define REWRITE_OPCODE(OC, GETOP, ...) \
do { opcode=getop_##GETOP (__VA_ARGS__); serializer_rewrite_opcode (OC, &opcode); } while (0)
do { opcode=getop_##GETOP (__VA_ARGS__); serializer_rewrite_opcode (OC, opcode); } while (0)
static T_IDX
integer_zero (void)
@@ -1835,9 +1831,6 @@ void
parser_init (void)
{
max_temp_name = temp_name = min_temp_name = lexer_get_reserved_ids_count ();
#ifdef __HOST
debug_file = __fopen ("parser.log", "w");
#endif
}
void