Edmund Grimley Evans wrote:
Last night I pushed a few commits to fix bugs uncovered by ASan and Valgrind. Comments and criticisms are welcome.
- tccgen.c: Fix memory leak involving asm_label. It would be better to record the asm_label as its (int) token numher. - cstr.data = 0; (and others) Use NULL. (This is not C++) - tccpp.c: Define and use tok_last for checking if last token is space. Is this important enough to make tcc (compiling itself) 2% slower? Maybe there is a better solution. After all if there is a space then it's because it has just been added. -- gr
Here's how you can repeat the tests: # ASan: make clean ./configure make cp libtcc.a libtcc.a.hide make clean ./configure --extra-cflags="-fsanitize=address -g" make cp libtcc.a.hide libtcc.a make test # Valgrind: make clean ./configure make # This is because Valgrind does floating-point arithmetic differently: ( cd tests && gcc -I.. tcctest.c && valgrind -q ./a.out > test.ref ) make test TCC="valgrind -q --leak-check=full `pwd`/tcc -B`pwd` -I`pwd`" _______________________________________________ Tinycc-devel mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/tinycc-devel
_______________________________________________ Tinycc-devel mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/tinycc-devel
