[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Tinycc-devel] Testing with ASan and Valgrind
From: |
grischka |
Subject: |
Re: [Tinycc-devel] Testing with ASan and Valgrind |
Date: |
Sat, 07 Nov 2015 17:39:37 +0100 |
User-agent: |
Thunderbird 2.0.0.23 (Windows/20090812) |
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
address@hidden
https://lists.nongnu.org/mailman/listinfo/tinycc-devel