With TinyCC commit 5201312cb242ea943848fcf864adacc44d3d190f, there is a stack
exhaustion bug.
Btw, for my previous bug, I think it can be fixed by adding one more check at
lines 8446 in tccgen.c.
$ cat test.c
int main() {
{
struct {
struct {};
} a();
}
a();
}
$ ./tcc -c -o tcc.o test.c
==8431==ERROR: AddressSanitizer: stack-overflow on address 0x7ffdb1afaff8 (pc
0x000000616a88 bp 0x7ffdb1afb010 sp 0x7ffdb1afb000 T0)
#0 0x616a87 (/root/git/tinycc/tcc+0x616a87)
#1 0x616d08 (/root/git/tinycc/tcc+0x616d08)
#2 0x616d08 (/root/git/tinycc/tcc+0x616d08)
#3 0x616d08 (/root/git/tinycc/tcc+0x616d08)
#4 0x616d08 (/root/git/tinycc/tcc+0x616d08)
#5 0x616d08 (/root/git/tinycc/tcc+0x616d08)
#6 0x616d08 (/root/git/tinycc/tcc+0x616d08)
#7 0x616d08 (/root/git/tinycc/tcc+0x616d08)
#8 0x616d08 (/root/git/tinycc/tcc+0x616d08)
#9 0x616d08 (/root/git/tinycc/tcc+0x616d08)
#10 0x616d08 (/root/git/tinycc/tcc+0x616d08)
#11 0x616d08 (/root/git/tinycc/tcc+0x616d08)
#12 0x616d08 (/root/git/tinycc/tcc+0x616d08)
#13 0x616d08 (/root/git/tinycc/tcc+0x616d08)
…...
#249 0x616d08 (/root/git/tinycc/tcc+0x616d08)
SUMMARY: AddressSanitizer: stack-overflow (/root/git/tinycc/tcc+0x616a87)
==8431==ABORTING
_______________________________________________
Tinycc-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel