Hi.
I encountered a memory corruption bug in libtcc. It seems to put
random data into random data structures of the program that are
unrelated to libtcc. I've been able to reproduce the bug using a
simple test-case, which is attached. The output of what I get when I
run the test-case is also attached.
I encountered the bug on a x86_64 linux system, and the test case was
compiled using gcc 4.6.2. It was linked against the latest git version
of tcc. What optimization flag you use with gcc seem to affect how the
bug manifests itself. The output I've attached is what I get when I
compile using -O2, if I compile using -O1 I get a segfault instead.
I can't debug this any further due to lack of knowledge of tcc
internals, but hopefully one of you can figure it out from this. If
you need any more information from me let me know.