Heyas,
Using libtcc in the following way shows up some bugs, the first bug
hides the second bug.
tcc=tcc_new();
tcc_add_file(tcc, bad.c); // returns 0 as expected
tcc_delete(tcc);
tcc=tcc_new(); // -- fails with :1: invalid macro name ''
The global state is left unclean because the error
From: egodust:
My version of tcc_export_binary_image() just *moves* the pointers
inside the state structure into the binary structure, tcc still owns
the memory, thats why *free() is needed, tcc_free() doesn't deep free
and tcc_delete() only works on TCCState objects.
Ah, okay. I thought you
Heyas,
On Sun, Apr 20, 2008 at 7:10 PM, grischka [EMAIL PROTECTED] wrote:
Ah, okay. I thought you wanted to copy all the section data into one
single piece of flat memory, like:
|text--data-bss---|
This to free is plain easy. It is (moderately) more complex to
make,
From: egodust:
1. tcc_new() MUST be matched by a tcc_delete() that share the same
sections, i.e. no mixing of different states, only ONE state is
allowed to exist at a time because of global copies.
No, that does not follow necessarily. It only means that
only one state can have global copies.
Hey,
On Sun, Apr 20, 2008 at 8:50 PM, grischka [EMAIL PROTECTED] wrote:
From: egodust:
1. tcc_new() MUST be matched by a tcc_delete() that share the same
sections, i.e. no mixing of different states, only ONE state is
allowed to exist at a time because of global copies.
No, that does
grischka wrote:
[...]
Well, I need to suggest something. So, maybe I'd move the bits in
tcc_delete, that mess with globals, out from tcc_delete into another
function. Then that function (name it tcc_cleanup) can be called
from tcc_new instead. How is this?
Well, speaking as someone who
From: David Given:
grischka wrote:
[...]
Well, I need to suggest something. So, maybe I'd move the bits in
tcc_delete, that mess with globals, out from tcc_delete into another
function. Then that function (name it tcc_cleanup) can be called
from tcc_new instead. How is this?
From: egodust:
Yes, but then there is a memory leak!, tcc_new() overwrites globals
with section data that tcc_delete() frees, it can only free the 'last
known' section, i.e.
As far as I can see all section data can be reached from the
TCCState itself. For example symtab_section is in the