[cfe-commits] RangeConstraintManager

Ted Kremenek kremenek at apple.com
Fri Feb 13 10:59:06 PST 2009


On Feb 13, 2009, at 9:01 AM, Ben Laurie wrote:

>> Looks great.  I'm a little concerned about the assumptions clients  
>> can make
>> on the returned "llvm::APSInt*" object.  It's lifetime is bound to  
>> the
>> lifetime of the Range object (which is bound to the ImmutableSet).   
>> In many
>> cases through the analyzer with use the "BasicValueManager" to  
>> unique APSInt
>> objects so that they can be compared using direct pointer  
>> comparison.  It
>> also takes care of some weird memory management issues.
>>
>> By default, the destructors of the objects allocated by an
>> ImmutableSet::Factory are not called.  APSInt actually can 'malloc()'
>> memory, meaning that if their destructors aren't called then this  
>> memory
>> will just get leaked.  Using BasicValueManager solves this problem  
>> since it
>> manually calls the destructors of the uniqued APSInt objects.
>
> AFAICS, BasicConstraintManager::getSymVal, which does the same thing,
> does not use BasicValueManager...

Then that's probably a bug.  I'll take a look.



More information about the cfe-commits mailing list