[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: possible bug
- From: Roberto Ierusalimschy <roberto@...>
- Date: Fri, 27 Mar 2009 12:47:06 -0300
> > Umm, I wouldn't classify this as a bug. The bounds checking tool
> > simply doesn't analyze the code deeply enough (no offense
> > intended, this is a tough problem). The lastfree pointer is never
> > used if the loop exits, because the table is rehashed in turn. So
> > this never causes any problems in reality.
> > I don't think this is an ANSI C violation either, because the
> > (now) invalid pointer is never used in a subsequent comparison.
> Yes, this is not a bug at all. I forgot that the decremented value
> was not being used.
Correcting again my diagnosis, this situation happens with all tables,
not only with those using dummynode. The last successful call to
getfreepos can always leave t->lastfree == t->node, so that in the
next call lastfree will be decremented out of the array (but not used).