On Feb 4, 2008, at 1:21 AM, Andy Lester wrote:
SymReg * r = _get_sym_typed(hsh, name, t);
if (r) {
free(name);
return r;
}
It's really saying "If I don't need a copy, then free what I assume
is a copy", rather than "If I need a copy,
While we're at it, how about the horror of delete_ins() being told
whether it should be freeing its argument?
--
Andy Lester => [EMAIL PROTECTED] => www.petdance.com => AIM:petdance
On Feb 4, 2008, at 12:44 AM, chromatic wrote:
SymReg * r = _get_sym_typed(hsh, name, t);
if (r) {
free(name);
return r;
}
It's really saying "If I don't need a copy, then free what I assume is
a copy", rather than "If I need a copy,
IMCC has a fair few memory leaks, and most of them come (eventually) from
calls to str_dup().
Why are there so many calls to str_dup()? Look in compilers/imcc/symreg.c at
_mk_symreg(). This function takes a parameter, char *name. Here's the funny
part:
SymReg * r = _get_sym_typed(hs