r182078 - [analyzer; alternate edges] don't add an edge incoming from the start of a function

Ted Kremenek kremenek at apple.com
Fri May 17 09:07:10 PDT 2013


I had similar thoughts.  That said, let's see how it feels in practice.  We can add it back if it feels missing.  We won't know until we experience it in practice.

On May 17, 2013, at 8:59 AM, Jordan Rose <jordan_rose at apple.com> wrote:

> I'm not sure this is a good idea. For the first stack frame, things that happen before the first event are (supposedly) unrelated to problem that occurs. For inlined functions, this isn't necessarily true—if the first thing the top-level function does is call the inlined function, then sure, but if there have already been events in the top-level function, not showing any arrows seems like we're pretending the intermediate code didn't happen.
> 
> To put it another way, I'm fine with chopping stuff off the beginning of the bug report, but a little antsy about removing stuff from the middle. But maybe I'm being silly, since we remove unimportant events from the middle already, including entire call stacks.
> 
> Jordan
> 
> 
> On May 16, 2013, at 23:48 , Ted Kremenek <kremenek at apple.com> wrote:
> 
>> Author: kremenek
>> Date: Fri May 17 01:48:22 2013
>> New Revision: 182078
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=182078&view=rev
>> Log:
>> [analyzer; alternate edges] don't add an edge incoming from the start of a function
>> for a nested call.  This matches what we do with the first stack frame.
>> 
>> Modified:
>>    cfe/trunk/lib/StaticAnalyzer/Core/BugReporter.cpp
>> 
>> Modified: cfe/trunk/lib/StaticAnalyzer/Core/BugReporter.cpp
>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/BugReporter.cpp?rev=182078&r1=182077&r2=182078&view=diff
>> ==============================================================================
>> --- cfe/trunk/lib/StaticAnalyzer/Core/BugReporter.cpp (original)
>> +++ cfe/trunk/lib/StaticAnalyzer/Core/BugReporter.cpp Fri May 17 01:48:22 2013
>> @@ -1594,14 +1594,6 @@ GenerateAlternateExtensivePathDiagnostic
>>       // call exit before this point.  This means that the path
>>       // terminated within the call itself.
>>       if (Optional<CallEnter> CE = P.getAs<CallEnter>()) {
>> -        // Add an edge to the start of the function.
>> -        const StackFrameContext *CalleeLC = CE->getCalleeContext();
>> -        PathDiagnosticLocation &PrevLocCallee = PrevLocMap[CalleeLC];
>> -        const Decl *D = CalleeLC->getDecl();
>> -        addEdgeToPath(PD.getActivePath(), PrevLocCallee,
>> -                      PathDiagnosticLocation::createBegin(D, SM),
>> -                      CalleeLC);
>> -
>>         // Did we visit an entire call?
>>         bool VisitedEntireCall = PD.isWithinCall();
>>         PD.popActivePath();
>> 
>> 
>> _______________________________________________
>> cfe-commits mailing list
>> cfe-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
> 

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


More information about the cfe-commits mailing list