[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
Tue Oct 30 09:13:41 PDT 2012
On Oct 29, 2012, at 20:32 , Anna Zaks <ganna at apple.com> wrote:
>
> On Oct 29, 2012, at 4:55 PM, Jordan Rose wrote:
>
>>
>> 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.
>
> Two calls to addTransition does not mean that we introduce bifurcation. We would have one node followed by the other one. Bifurcation is when one node has two successors, which leads to exponential blow up.
Oops, I didn't notice that you explicitly specified the predecessor the second time. My bad.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20121030/932b597a/attachment.html>
More information about the cfe-commits
mailing list