[cfe-dev] Allowing checkers to mark symbols as live

Jordy Rose jediknil at belkadan.com
Mon Aug 9 21:30:32 PDT 2010


On Mon, 9 Aug 2010 20:43:31 -0700, Ted Kremenek <kremenek at apple.com>
wrote:
> On Aug 9, 2010, at 7:17 PM, Zhongxing Xu wrote:
> 
>> I'm inclined to Jordy's original proposal that Checkers should be able
>> to control some symbols that only they know what the symbol means,
>> when the symbol dies.
> 
> My point was that the checker shouldn't have to do anything special to
> extend the lifetime of a symbol.  For symbols that annotate MemRegions,
the
> lifetime of the symbol is inherently bound to the lifetime of the
> MemRegion.  It seems far more natural to me, more efficient, and far
less
> error prone to have SymbolManager::isLive() understand that the lifetime
of
> one symbol is tied to another (declaratively) then having the checker
doing
> something ad hoc on the side.

How can you kill such a symbol, though? If we keep immutable symbols
around until their associated regions die, and the string length gets
invalidated and requested several times, we end up with several dead
symbols that are still tied to a live region.

(I'm not objecting to finding a better solution than MarkLiveSymbols, just
trying to bring up all the requirements. The current scheme has the problem
that the checker doesn't know when the symbols /should/ die.)



More information about the cfe-dev mailing list