It looks that multi-times initialization don't affect anything. Only call to the free_defines(define_start) in tcc_preprocess() is removed in assumption that free_defines(NULL) in tcc_cleanup() will free all defines.
Unified · Split
| @@ -3203,14 +3203,11 @@ static void line_macro_output(BufferedFile *f, const char *s, TCCState *s1) · 3202 unmodified lines | |||
| 3203 | /* Preprocess the current file */ | 3203 | /* Preprocess the current file */ |
| 3204 | ST_FUNC int tcc_preprocess(TCCState *s1) | 3204 | ST_FUNC int tcc_preprocess(TCCState *s1) |
| 3205 | { | 3205 | { |
| 3206 | Sym *define_start; | ||
| 3207 | |||
| 3208 | BufferedFile *file_ref, **iptr, **iptr_new; | 3206 | BufferedFile *file_ref, **iptr, **iptr_new; |
| 3209 | int token_seen, d; | 3207 | int token_seen, d; |
| 3210 | const char *s; | 3208 | const char *s; |
| 3211 | 3209 | ||
| 3212 | preprocess_init(s1); | 3210 | preprocess_init(s1); |
| 3213 | define_start = define_stack; | ||
| 3214 | ch = file->buf_ptr[0]; | 3211 | ch = file->buf_ptr[0]; |
| 3215 | tok_flags = TOK_FLAG_BOL | TOK_FLAG_BOF; | 3212 | tok_flags = TOK_FLAG_BOL | TOK_FLAG_BOF; |
| 3216 | parse_flags = PARSE_FLAG_ASM_COMMENTS | PARSE_FLAG_PREPROCESS | | 3213 | parse_flags = PARSE_FLAG_ASM_COMMENTS | PARSE_FLAG_PREPROCESS | |
| @@ -3258,6 +3255,5 @@ print_line: · 41 unmodified lines | |||
| 3258 | } | 3255 | } |
| 3259 | fputs(get_tok_str(tok, &tokc), s1->ppfp); | 3256 | fputs(get_tok_str(tok, &tokc), s1->ppfp); |
| 3260 | } | 3257 | } |
| 3261 | free_defines(define_start); | ||
| 3262 | return 0; | 3258 | return 0; |
| 3263 | } | 3259 | } |