Problem with libiberty's hash tables
FX
fxcoudert@gmail.com
Fri Feb 15 14:39:00 GMT 2008
Ouch... I got it, it indeed was a beginner mistake. Looking through
GCC to see how it used these hash tables, I noticed the problem. Sorry
for the noise!
PS: for posterity, the error was:
> /* Register this allocation. */
> a = (allocation_t *) htab_find_slot (tab, p, INSERT);
> a->p = p;
> a->file = file;
This should have been:
allocation_t **a;
/* Register this allocation. */
a = (allocation_t **) htab_find_slot (tab, p, INSERT);
*a = malloc (sizeof (allocation_t));
(*a)->p = p;
(*a)->file = file;
and later accordingly.
--
FX Coudert
http://www.homepages.ucl.ac.uk/~uccafco/
More information about the Gcc
mailing list