[cfe-commits] r166976 - in /cfe/trunk: lib/StaticAnalyzer/Checkers/CMakeLists.txt lib/StaticAnalyzer/Checkers/Checkers.td lib/StaticAnalyzer/Checkers/SimpleStreamChecker.cpp test/Analysis/simple-stream-checks.c

Jordan Rose jordan_rose at apple.com
Mon Oct 29 16:55:35 PDT 2012


On Oct 29, 2012, at 16:19 , Jordan Rose <jordan_rose at apple.com> wrote:

> 
> On Oct 29, 2012, at 15:51 , Anna Zaks <ganna at apple.com> wrote:
> 
>> +ExplodedNode *SimpleStreamChecker::reportLeaks(SymbolVector LeakedStreams,
>> +                                               CheckerContext &C) const {
>> +  ExplodedNode *Pred = C.getPredecessor();
>> +  if (LeakedStreams.empty())
>> +    return Pred;
>> +
>> +  // Generate an intermediate node representing the leak point.
>> +  static SimpleProgramPointTag Tag("StreamChecker : Leak");
>> +  ExplodedNode *ErrNode = C.addTransition(Pred->getState(), Pred, &Tag);
>> +  if (!ErrNode)
>> +    return Pred;
> 
> Why generate an intermediate node at all? I feel like we could just generate the transition in the caller and then report all the leaks here.

Oops, actually this is a bug, even in the final version (next commit). Two addTransition calls = bifurcation.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20121029/85a45081/attachment.html>


More information about the cfe-commits mailing list