Le jeudi 1 janvier 2015, 14:17:10 Sergey Korshunoff a écrit :
> Free a memory allocted to identifiers table in the previous call to
> the preprocess_new() function. Do the same when calling
> tcc_preprocess(0)
diff -urN tinycc.old/tccpp.c tinycc/tccpp.c
--- tinycc.old/tccpp.c 2014-12-30 18:33:52.000000000 +0300
+++ tinycc/tccpp.c 2015-01-01 14:01:36.000000000 +0300
@@ -3111,6 +3111,8 @@
isidnum_table[i-CH_EOF] = isid(i) || isnum(i);
/* add all tokens */
+ if (table_ident)
+ tcc_free (table_ident);
table_ident = NULL;
memset(hash_ident, 0, TOK_HASH_SIZE * sizeof(TokenSym *));
The free should be done by calling tcc_cleanup. Also the if is useless as free
does nothing if its parameter is NULL.
Could you post a testcase of the problem you are encountering? That would help
me understand why this patch is necessary.
Best regards,
Thomas
_______________________________________________
Tinycc-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel