[cfe-commits] r162563 - in /cfe/trunk: lib/StaticAnalyzer/Core/BugReporterVisitors.cpp test/Analysis/inlining/path-notes.c

Jordan Rose jordan_rose at apple.com
Fri Aug 24 19:15:13 PDT 2012


:-( You're right. Will fix comments, and look into this other example...on Monday.

On Aug 24, 2012, at 18:57 , Anna Zaks <ganna at apple.com> wrote:

> This needs a lot more comments!
> 
> Also, this example should probably be handled by this as well:
> int *getZero() {
>   int *p = 0;
>   return p;
> }
> int testReturnZero() {
>   return *getZero();  // If you change it to '*getZero() = 1;' as in you example, it works.
> }
> On Aug 24, 2012, at 9:34 AM, Jordan Rose wrote:
> 
>> Author: jrose
>> Date: Fri Aug 24 11:34:31 2012
>> New Revision: 162563
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=162563&view=rev
>> Log:
>> [analyzer] If we dereference a NULL that came from a function, show the return.
>> 
>> More generally, any time we try to track where a null value came from, we
>> should show if it came from a function. This usually isn't necessary if
>> the value is symbolic, but if the value is just a constant we previously
>> just ignored its origin entirely. Now, we'll step into the function and
>> recursively add a visitor to the returned expression.
>> 
>> <rdar://problem/12114609>
>> 
>> Modified:
>>    cfe/trunk/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
>>    cfe/trunk/test/Analysis/inlining/path-notes.c
>> 
>> Modified: cfe/trunk/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp?rev=162563&r1=162562&r2=162563&view=diff
>> ==============================================================================
>> --- cfe/trunk/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp (original)
>> +++ cfe/trunk/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp Fri Aug 24 11:34:31 2012
>> @@ -296,6 +296,49 @@
>>   return NULL;
>> }
>> 
>> +namespace {
> comment
>> +class ReturnNullVisitor : public BugReporterVisitorImpl<ReturnNullVisitor> {
>> +  const ExplodedNode *ReturnNode;
>> +public:
>> +  ReturnNullVisitor(const ExplodedNode *N) : ReturnNode(N) {}
>> +
>> +  virtual void Profile(llvm::FoldingSetNodeID &ID) const {
>> +    static int Tag = 0;
>> +    ID.AddPointer(&Tag);
>> +    ID.Add(*ReturnNode);
>> +  }
>> +
>> +  PathDiagnosticPiece *VisitNode(const ExplodedNode *N,
>> +                                 const ExplodedNode *PrevN,
>> +                                 BugReporterContext &BRC,
>> +                                 BugReport &BR) {
>> +    if (ReturnNode != BRC.getNodeResolver().getOriginalNode(N))
>> +      return 0;
>> +
>> +    StmtPoint SP = cast<StmtPoint>(ReturnNode->getLocation());
>> +    const ReturnStmt *Ret = cast<ReturnStmt>(SP.getStmt());
>> +    PathDiagnosticLocation L(Ret, BRC.getSourceManager(),
>> +                             N->getLocationContext());
>> +
>> +    SmallString<64> Msg;
>> +    llvm::raw_svector_ostream Out(Msg);
>> +
>> +    if (Loc::isLocType(Ret->getRetValue()->getType()))
>> +      Out << "Returning null pointer";
>> +    else
>> +      Out << "Returning zero";
>> +
>> +    // FIXME: We should have a more generalized printing mechanism.
>> +    const Expr *RetE = Ret->getRetValue()->IgnoreParenCasts();
>> +    if (const DeclRefExpr *DR = dyn_cast<DeclRefExpr>(RetE))
>> +      if (const DeclaratorDecl *DD = dyn_cast<DeclaratorDecl>(DR->getDecl()))
>> +        Out << " (loaded from '" << *DD << "')";
>> +
>> +    return new PathDiagnosticEventPiece(L, Out.str());
>> +  }
>> +};
>> +} // end anonymous namespace
>> +
>> void bugreporter::addTrackNullOrUndefValueVisitor(const ExplodedNode *N,
> 
>> "..Visitor" -> "..Visitors" and let's add comments to this function as well.
> 
>>                                                   const Stmt *S,
>>                                                   BugReport *report) {
>> @@ -311,6 +354,9 @@
>>     if (const PostStmt *ps = dyn_cast<PostStmt>(&pp)) {
>>       if (ps->getStmt() == S)
>>         break;
>> +    } else if (const CallExitEnd *CEE = dyn_cast<CallExitEnd>(&pp)) {
>> +      if (CEE->getCalleeContext()->getCallSite() == S)
>> +        break;
>>     }
>>     N = N->getFirstPred();
>>   }
>> @@ -364,6 +410,28 @@
>>       report->addVisitor(new TrackConstraintBRVisitor(loc::MemRegionVal(R),
>>                                                       false));
>>     }
>> +  } else {
> Please, explain what we are trying to achieve here. Ex: "If the interesting statement 'S' is the call exit statement, visit its return with ReturnNullVisitor and track the returned value with undef or null visitors."
> I hope I got it right:)
> 
>> +    // Walk backwards to just before the post-statement checks.
> This looks like it belongs to the entire else, not just the single-line 'while' loop below.
>> 
>> +    ProgramPoint PP = N->getLocation();
>> +    while (N && isa<PostStmt>(PP = N->getLocation()))
>> +      N = N->getFirstPred();
>> +
>> +    if (N && isa<CallExitEnd>(PP)) {
>> +      // Find a ReturnStmt, if there is one.
>> +      do {
>> +        N = N->getFirstPred();
>> +        PP = N->getLocation();
>> +      } while (!isa<StmtPoint>(PP) && !isa<CallEnter>(PP));
>> +
>> +      if (const StmtPoint *SP = dyn_cast<StmtPoint>(&PP)) {
>> +        if (const ReturnStmt *Ret = SP->getStmtAs<ReturnStmt>()) {
>> +          if (const Expr *RetE = Ret->getRetValue()) {
>> +            report->addVisitor(new ReturnNullVisitor(N));
> comment
>> +            addTrackNullOrUndefValueVisitor(N, RetE, report);
>> +          }
>> +        }
>> +      }
>> +    }
>>   }
>> }
>> 
>> 
>> Modified: cfe/trunk/test/Analysis/inlining/path-notes.c
>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/inlining/path-notes.c?rev=162563&r1=162562&r2=162563&view=diff
>> ==============================================================================
>> --- cfe/trunk/test/Analysis/inlining/path-notes.c (original)
>> +++ cfe/trunk/test/Analysis/inlining/path-notes.c Fri Aug 24 11:34:31 2012
>> @@ -57,6 +57,38 @@
>> }
>> 
>> 
>> +int *getZero() {
>> +  int *p = 0;
>> +  // expected-note at -1 {{Variable 'p' initialized to a null pointer value}}
>> +  // ^ This note checks that we add a second visitor for the return value.
>> +  return p;
>> +  // expected-note at -1 {{Returning null pointer (loaded from 'p')}}
>> +}
>> +
>> +void testReturnZero() {
>> +  *getZero() = 1; // expected-warning{{Dereference of null pointer}}
>> +  // expected-note at -1 {{Calling 'getZero'}}
>> +  // expected-note at -2 {{Returning from 'getZero'}}
>> +  // expected-note at -3 {{Dereference of null pointer}}
>> +}
>> +
>> +void testInitZero() {
>> +  // FIXME: <rdar://problem/12114689> Diagnostics: Need to step into the function whose result is assigned to an interesting region
>> +  int *a = getZero();
>> +  // expected-note at -1 {{Variable 'a' initialized to a null pointer value}}
>> +  *a = 1; // expected-warning{{Dereference of null pointer}}
>> +  // expected-note at -1 {{Dereference of null pointer (loaded from variable 'a')}}
>> +}
>> +
>> +void testStoreZero(int *a) {
>> +  // FIXME: <rdar://problem/12114689> Diagnostics: Need to step into the function whose result is assigned to an interesting region
>> +  a = getZero();
>> +  // expected-note at -1 {{Null pointer value stored to 'a'}}
>> +  *a = 1; // expected-warning{{Dereference of null pointer}}
>> +  // expected-note at -1 {{Dereference of null pointer (loaded from variable 'a')}}
>> +}
>> +
>> +
>> // CHECK: <?xml version="1.0" encoding="UTF-8"?>
>> // CHECK: <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
>> // CHECK: <plist version="1.0">
>> @@ -1286,6 +1318,774 @@
>> // CHECK:    <key>file</key><integer>0</integer>
>> // CHECK:   </dict>
>> // CHECK:   </dict>
>> +// CHECK:   <dict>
>> +// CHECK:    <key>path</key>
>> +// CHECK:    <array>
>> +// CHECK:     <dict>
>> +// CHECK:      <key>kind</key><string>control</string>
>> +// CHECK:      <key>edges</key>
>> +// CHECK:       <array>
>> +// CHECK:        <dict>
>> +// CHECK:         <key>start</key>
>> +// CHECK:          <array>
>> +// CHECK:           <dict>
>> +// CHECK:            <key>line</key><integer>69</integer>
>> +// CHECK:            <key>col</key><integer>3</integer>
>> +// CHECK:            <key>file</key><integer>0</integer>
>> +// CHECK:           </dict>
>> +// CHECK:           <dict>
>> +// CHECK:            <key>line</key><integer>69</integer>
>> +// CHECK:            <key>col</key><integer>3</integer>
>> +// CHECK:            <key>file</key><integer>0</integer>
>> +// CHECK:           </dict>
>> +// CHECK:          </array>
>> +// CHECK:         <key>end</key>
>> +// CHECK:          <array>
>> +// CHECK:           <dict>
>> +// CHECK:            <key>line</key><integer>69</integer>
>> +// CHECK:            <key>col</key><integer>4</integer>
>> +// CHECK:            <key>file</key><integer>0</integer>
>> +// CHECK:           </dict>
>> +// CHECK:           <dict>
>> +// CHECK:            <key>line</key><integer>69</integer>
>> +// CHECK:            <key>col</key><integer>10</integer>
>> +// CHECK:            <key>file</key><integer>0</integer>
>> +// CHECK:           </dict>
>> +// CHECK:          </array>
>> +// CHECK:        </dict>
>> +// CHECK:       </array>
>> +// CHECK:     </dict>
>> +// CHECK:     <dict>
>> +// CHECK:      <key>kind</key><string>event</string>
>> +// CHECK:      <key>location</key>
>> +// CHECK:      <dict>
>> +// CHECK:       <key>line</key><integer>69</integer>
>> +// CHECK:       <key>col</key><integer>4</integer>
>> +// CHECK:       <key>file</key><integer>0</integer>
>> +// CHECK:      </dict>
>> +// CHECK:      <key>ranges</key>
>> +// CHECK:      <array>
>> +// CHECK:        <array>
>> +// CHECK:         <dict>
>> +// CHECK:          <key>line</key><integer>69</integer>
>> +// CHECK:          <key>col</key><integer>4</integer>
>> +// CHECK:          <key>file</key><integer>0</integer>
>> +// CHECK:         </dict>
>> +// CHECK:         <dict>
>> +// CHECK:          <key>line</key><integer>69</integer>
>> +// CHECK:          <key>col</key><integer>12</integer>
>> +// CHECK:          <key>file</key><integer>0</integer>
>> +// CHECK:         </dict>
>> +// CHECK:        </array>
>> +// CHECK:      </array>
>> +// CHECK:      <key>depth</key><integer>0</integer>
>> +// CHECK:      <key>extended_message</key>
>> +// CHECK:      <string>Calling 'getZero'</string>
>> +// CHECK:      <key>message</key>
>> +// CHECK: <string>Calling 'getZero'</string>
>> +// CHECK:     </dict>
>> +// CHECK:     <dict>
>> +// CHECK:      <key>kind</key><string>event</string>
>> +// CHECK:      <key>location</key>
>> +// CHECK:      <dict>
>> +// CHECK:       <key>line</key><integer>60</integer>
>> +// CHECK:       <key>col</key><integer>1</integer>
>> +// CHECK:       <key>file</key><integer>0</integer>
>> +// CHECK:      </dict>
>> +// CHECK:      <key>depth</key><integer>1</integer>
>> +// CHECK:      <key>extended_message</key>
>> +// CHECK:      <string>Entered call from 'testReturnZero'</string>
>> +// CHECK:      <key>message</key>
>> +// CHECK: <string>Entered call from 'testReturnZero'</string>
>> +// CHECK:     </dict>
>> +// CHECK:     <dict>
>> +// CHECK:      <key>kind</key><string>control</string>
>> +// CHECK:      <key>edges</key>
>> +// CHECK:       <array>
>> +// CHECK:        <dict>
>> +// CHECK:         <key>start</key>
>> +// CHECK:          <array>
>> +// CHECK:           <dict>
>> +// CHECK:            <key>line</key><integer>60</integer>
>> +// CHECK:            <key>col</key><integer>1</integer>
>> +// CHECK:            <key>file</key><integer>0</integer>
>> +// CHECK:           </dict>
>> +// CHECK:           <dict>
>> +// CHECK:            <key>line</key><integer>60</integer>
>> +// CHECK:            <key>col</key><integer>3</integer>
>> +// CHECK:            <key>file</key><integer>0</integer>
>> +// CHECK:           </dict>
>> +// CHECK:          </array>
>> +// CHECK:         <key>end</key>
>> +// CHECK:          <array>
>> +// CHECK:           <dict>
>> +// CHECK:            <key>line</key><integer>61</integer>
>> +// CHECK:            <key>col</key><integer>3</integer>
>> +// CHECK:            <key>file</key><integer>0</integer>
>> +// CHECK:           </dict>
>> +// CHECK:           <dict>
>> +// CHECK:            <key>line</key><integer>61</integer>
>> +// CHECK:            <key>col</key><integer>5</integer>
>> +// CHECK:            <key>file</key><integer>0</integer>
>> +// CHECK:           </dict>
>> +// CHECK:          </array>
>> +// CHECK:        </dict>
>> +// CHECK:       </array>
>> +// CHECK:     </dict>
>> +// CHECK:     <dict>
>> +// CHECK:      <key>kind</key><string>event</string>
>> +// CHECK:      <key>location</key>
>> +// CHECK:      <dict>
>> +// CHECK:       <key>line</key><integer>61</integer>
>> +// CHECK:       <key>col</key><integer>3</integer>
>> +// CHECK:       <key>file</key><integer>0</integer>
>> +// CHECK:      </dict>
>> +// CHECK:      <key>ranges</key>
>> +// CHECK:      <array>
>> +// CHECK:        <array>
>> +// CHECK:         <dict>
>> +// CHECK:          <key>line</key><integer>61</integer>
>> +// CHECK:          <key>col</key><integer>3</integer>
>> +// CHECK:          <key>file</key><integer>0</integer>
>> +// CHECK:         </dict>
>> +// CHECK:         <dict>
>> +// CHECK:          <key>line</key><integer>61</integer>
>> +// CHECK:          <key>col</key><integer>8</integer>
>> +// CHECK:          <key>file</key><integer>0</integer>
>> +// CHECK:         </dict>
>> +// CHECK:        </array>
>> +// CHECK:      </array>
>> +// CHECK:      <key>depth</key><integer>1</integer>
>> +// CHECK:      <key>extended_message</key>
>> +// CHECK:      <string>Variable 'p' initialized to a null pointer value</string>
>> +// CHECK:      <key>message</key>
>> +// CHECK: <string>Variable 'p' initialized to a null pointer value</string>
>> +// CHECK:     </dict>
>> +// CHECK:     <dict>
>> +// CHECK:      <key>kind</key><string>control</string>
>> +// CHECK:      <key>edges</key>
>> +// CHECK:       <array>
>> +// CHECK:        <dict>
>> +// CHECK:         <key>start</key>
>> +// CHECK:          <array>
>> +// CHECK:           <dict>
>> +// CHECK:            <key>line</key><integer>61</integer>
>> +// CHECK:            <key>col</key><integer>3</integer>
>> +// CHECK:            <key>file</key><integer>0</integer>
>> +// CHECK:           </dict>
>> +// CHECK:           <dict>
>> +// CHECK:            <key>line</key><integer>61</integer>
>> +// CHECK:            <key>col</key><integer>5</integer>
>> +// CHECK:            <key>file</key><integer>0</integer>
>> +// CHECK:           </dict>
>> +// CHECK:          </array>
>> +// CHECK:         <key>end</key>
>> +// CHECK:          <array>
>> +// CHECK:           <dict>
>> +// CHECK:            <key>line</key><integer>64</integer>
>> +// CHECK:            <key>col</key><integer>3</integer>
>> +// CHECK:            <key>file</key><integer>0</integer>
>> +// CHECK:           </dict>
>> +// CHECK:           <dict>
>> +// CHECK:            <key>line</key><integer>64</integer>
>> +// CHECK:            <key>col</key><integer>8</integer>
>> +// CHECK:            <key>file</key><integer>0</integer>
>> +// CHECK:           </dict>
>> +// CHECK:          </array>
>> +// CHECK:        </dict>
>> +// CHECK:       </array>
>> +// CHECK:     </dict>
>> +// CHECK:     <dict>
>> +// CHECK:      <key>kind</key><string>event</string>
>> +// CHECK:      <key>location</key>
>> +// CHECK:      <dict>
>> +// CHECK:       <key>line</key><integer>64</integer>
>> +// CHECK:       <key>col</key><integer>3</integer>
>> +// CHECK:       <key>file</key><integer>0</integer>
>> +// CHECK:      </dict>
>> +// CHECK:      <key>ranges</key>
>> +// CHECK:      <array>
>> +// CHECK:        <array>
>> +// CHECK:         <dict>
>> +// CHECK:          <key>line</key><integer>64</integer>
>> +// CHECK:          <key>col</key><integer>3</integer>
>> +// CHECK:          <key>file</key><integer>0</integer>
>> +// CHECK:         </dict>
>> +// CHECK:         <dict>
>> +// CHECK:          <key>line</key><integer>64</integer>
>> +// CHECK:          <key>col</key><integer>10</integer>
>> +// CHECK:          <key>file</key><integer>0</integer>
>> +// CHECK:         </dict>
>> +// CHECK:        </array>
>> +// CHECK:      </array>
>> +// CHECK:      <key>depth</key><integer>1</integer>
>> +// CHECK:      <key>extended_message</key>
>> +// CHECK:      <string>Returning null pointer (loaded from 'p')</string>
>> +// CHECK:      <key>message</key>
>> +// CHECK: <string>Returning null pointer (loaded from 'p')</string>
>> +// CHECK:     </dict>
>> +// CHECK:     <dict>
>> +// CHECK:      <key>kind</key><string>event</string>
>> +// CHECK:      <key>location</key>
>> +// CHECK:      <dict>
>> +// CHECK:       <key>line</key><integer>69</integer>
>> +// CHECK:       <key>col</key><integer>4</integer>
>> +// CHECK:       <key>file</key><integer>0</integer>
>> +// CHECK:      </dict>
>> +// CHECK:      <key>ranges</key>
>> +// CHECK:      <array>
>> +// CHECK:        <array>
>> +// CHECK:         <dict>
>> +// CHECK:          <key>line</key><integer>69</integer>
>> +// CHECK:          <key>col</key><integer>4</integer>
>> +// CHECK:          <key>file</key><integer>0</integer>
>> +// CHECK:         </dict>
>> +// CHECK:         <dict>
>> +// CHECK:          <key>line</key><integer>69</integer>
>> +// CHECK:          <key>col</key><integer>12</integer>
>> +// CHECK:          <key>file</key><integer>0</integer>
>> +// CHECK:         </dict>
>> +// CHECK:        </array>
>> +// CHECK:      </array>
>> +// CHECK:      <key>depth</key><integer>1</integer>
>> +// CHECK:      <key>extended_message</key>
>> +// CHECK:      <string>Returning from 'getZero'</string>
>> +// CHECK:      <key>message</key>
>> +// CHECK: <string>Returning from 'getZero'</string>
>> +// CHECK:     </dict>
>> +// CHECK:     <dict>
>> +// CHECK:      <key>kind</key><string>control</string>
>> +// CHECK:      <key>edges</key>
>> +// CHECK:       <array>
>> +// CHECK:        <dict>
>> +// CHECK:         <key>start</key>
>> +// CHECK:          <array>
>> +// CHECK:           <dict>
>> +// CHECK:            <key>line</key><integer>69</integer>
>> +// CHECK:            <key>col</key><integer>3</integer>
>> +// CHECK:            <key>file</key><integer>0</integer>
>> +// CHECK:           </dict>
>> +// CHECK:           <dict>
>> +// CHECK:            <key>line</key><integer>69</integer>
>> +// CHECK:            <key>col</key><integer>3</integer>
>> +// CHECK:            <key>file</key><integer>0</integer>
>> +// CHECK:           </dict>
>> +// CHECK:          </array>
>> +// CHECK:         <key>end</key>
>> +// CHECK:          <array>
>> +// CHECK:           <dict>
>> +// CHECK:            <key>line</key><integer>69</integer>
>> +// CHECK:            <key>col</key><integer>4</integer>
>> +// CHECK:            <key>file</key><integer>0</integer>
>> +// CHECK:           </dict>
>> +// CHECK:           <dict>
>> +// CHECK:            <key>line</key><integer>69</integer>
>> +// CHECK:            <key>col</key><integer>10</integer>
>> +// CHECK:            <key>file</key><integer>0</integer>
>> +// CHECK:           </dict>
>> +// CHECK:          </array>
>> +// CHECK:        </dict>
>> +// CHECK:       </array>
>> +// CHECK:     </dict>
>> +// CHECK:     <dict>
>> +// CHECK:      <key>kind</key><string>control</string>
>> +// CHECK:      <key>edges</key>
>> +// CHECK:       <array>
>> +// CHECK:        <dict>
>> +// CHECK:         <key>start</key>
>> +// CHECK:          <array>
>> +// CHECK:           <dict>
>> +// CHECK:            <key>line</key><integer>69</integer>
>> +// CHECK:            <key>col</key><integer>4</integer>
>> +// CHECK:            <key>file</key><integer>0</integer>
>> +// CHECK:           </dict>
>> +// CHECK:           <dict>
>> +// CHECK:            <key>line</key><integer>69</integer>
>> +// CHECK:            <key>col</key><integer>10</integer>
>> +// CHECK:            <key>file</key><integer>0</integer>
>> +// CHECK:           </dict>
>> +// CHECK:          </array>
>> +// CHECK:         <key>end</key>
>> +// CHECK:          <array>
>> +// CHECK:           <dict>
>> +// CHECK:            <key>line</key><integer>69</integer>
>> +// CHECK:            <key>col</key><integer>3</integer>
>> +// CHECK:            <key>file</key><integer>0</integer>
>> +// CHECK:           </dict>
>> +// CHECK:           <dict>
>> +// CHECK:            <key>line</key><integer>69</integer>
>> +// CHECK:            <key>col</key><integer>3</integer>
>> +// CHECK:            <key>file</key><integer>0</integer>
>> +// CHECK:           </dict>
>> +// CHECK:          </array>
>> +// CHECK:        </dict>
>> +// CHECK:       </array>
>> +// CHECK:     </dict>
>> +// CHECK:     <dict>
>> +// CHECK:      <key>kind</key><string>event</string>
>> +// CHECK:      <key>location</key>
>> +// CHECK:      <dict>
>> +// CHECK:       <key>line</key><integer>69</integer>
>> +// CHECK:       <key>col</key><integer>3</integer>
>> +// CHECK:       <key>file</key><integer>0</integer>
>> +// CHECK:      </dict>
>> +// CHECK:      <key>ranges</key>
>> +// CHECK:      <array>
>> +// CHECK:        <array>
>> +// CHECK:         <dict>
>> +// CHECK:          <key>line</key><integer>69</integer>
>> +// CHECK:          <key>col</key><integer>3</integer>
>> +// CHECK:          <key>file</key><integer>0</integer>
>> +// CHECK:         </dict>
>> +// CHECK:         <dict>
>> +// CHECK:          <key>line</key><integer>69</integer>
>> +// CHECK:          <key>col</key><integer>16</integer>
>> +// CHECK:          <key>file</key><integer>0</integer>
>> +// CHECK:         </dict>
>> +// CHECK:        </array>
>> +// CHECK:      </array>
>> +// CHECK:      <key>depth</key><integer>0</integer>
>> +// CHECK:      <key>extended_message</key>
>> +// CHECK:      <string>Dereference of null pointer</string>
>> +// CHECK:      <key>message</key>
>> +// CHECK: <string>Dereference of null pointer</string>
>> +// CHECK:     </dict>
>> +// CHECK:    </array>
>> +// CHECK:    <key>description</key><string>Dereference of null pointer</string>
>> +// CHECK:    <key>category</key><string>Logic error</string>
>> +// CHECK:    <key>type</key><string>Dereference of null pointer</string>
>> +// CHECK:   <key>issue_context_kind</key><string>function</string>
>> +// CHECK:   <key>issue_context</key><string>testReturnZero</string>
>> +// CHECK:   <key>issue_hash</key><integer>1</integer>
>> +// CHECK:   <key>location</key>
>> +// CHECK:   <dict>
>> +// CHECK:    <key>line</key><integer>69</integer>
>> +// CHECK:    <key>col</key><integer>3</integer>
>> +// CHECK:    <key>file</key><integer>0</integer>
>> +// CHECK:   </dict>
>> +// CHECK:   </dict>
>> +// CHECK:   <dict>
>> +// CHECK:    <key>path</key>
>> +// CHECK:    <array>
>> +// CHECK:     <dict>
>> +// CHECK:      <key>kind</key><string>control</string>
>> +// CHECK:      <key>edges</key>
>> +// CHECK:       <array>
>> +// CHECK:        <dict>
>> +// CHECK:         <key>start</key>
>> +// CHECK:          <array>
>> +// CHECK:           <dict>
>> +// CHECK:            <key>line</key><integer>77</integer>
>> +// CHECK:            <key>col</key><integer>3</integer>
>> +// CHECK:            <key>file</key><integer>0</integer>
>> +// CHECK:           </dict>
>> +// CHECK:           <dict>
>> +// CHECK:            <key>line</key><integer>77</integer>
>> +// CHECK:            <key>col</key><integer>5</integer>
>> +// CHECK:            <key>file</key><integer>0</integer>
>> +// CHECK:           </dict>
>> +// CHECK:          </array>
>> +// CHECK:         <key>end</key>
>> +// CHECK:          <array>
>> +// CHECK:           <dict>
>> +// CHECK:            <key>line</key><integer>77</integer>
>> +// CHECK:            <key>col</key><integer>12</integer>
>> +// CHECK:            <key>file</key><integer>0</integer>
>> +// CHECK:           </dict>
>> +// CHECK:           <dict>
>> +// CHECK:            <key>line</key><integer>77</integer>
>> +// CHECK:            <key>col</key><integer>18</integer>
>> +// CHECK:            <key>file</key><integer>0</integer>
>> +// CHECK:           </dict>
>> +// CHECK:          </array>
>> +// CHECK:        </dict>
>> +// CHECK:       </array>
>> +// CHECK:     </dict>
>> +// CHECK:     <dict>
>> +// CHECK:      <key>kind</key><string>control</string>
>> +// CHECK:      <key>edges</key>
>> +// CHECK:       <array>
>> +// CHECK:        <dict>
>> +// CHECK:         <key>start</key>
>> +// CHECK:          <array>
>> +// CHECK:           <dict>
>> +// CHECK:            <key>line</key><integer>77</integer>
>> +// CHECK:            <key>col</key><integer>3</integer>
>> +// CHECK:            <key>file</key><integer>0</integer>
>> +// CHECK:           </dict>
>> +// CHECK:           <dict>
>> +// CHECK:            <key>line</key><integer>77</integer>
>> +// CHECK:            <key>col</key><integer>5</integer>
>> +// CHECK:            <key>file</key><integer>0</integer>
>> +// CHECK:           </dict>
>> +// CHECK:          </array>
>> +// CHECK:         <key>end</key>
>> +// CHECK:          <array>
>> +// CHECK:           <dict>
>> +// CHECK:            <key>line</key><integer>77</integer>
>> +// CHECK:            <key>col</key><integer>12</integer>
>> +// CHECK:            <key>file</key><integer>0</integer>
>> +// CHECK:           </dict>
>> +// CHECK:           <dict>
>> +// CHECK:            <key>line</key><integer>77</integer>
>> +// CHECK:            <key>col</key><integer>18</integer>
>> +// CHECK:            <key>file</key><integer>0</integer>
>> +// CHECK:           </dict>
>> +// CHECK:          </array>
>> +// CHECK:        </dict>
>> +// CHECK:       </array>
>> +// CHECK:     </dict>
>> +// CHECK:     <dict>
>> +// CHECK:      <key>kind</key><string>control</string>
>> +// CHECK:      <key>edges</key>
>> +// CHECK:       <array>
>> +// CHECK:        <dict>
>> +// CHECK:         <key>start</key>
>> +// CHECK:          <array>
>> +// CHECK:           <dict>
>> +// CHECK:            <key>line</key><integer>77</integer>
>> +// CHECK:            <key>col</key><integer>12</integer>
>> +// CHECK:            <key>file</key><integer>0</integer>
>> +// CHECK:           </dict>
>> +// CHECK:           <dict>
>> +// CHECK:            <key>line</key><integer>77</integer>
>> +// CHECK:            <key>col</key><integer>18</integer>
>> +// CHECK:            <key>file</key><integer>0</integer>
>> +// CHECK:           </dict>
>> +// CHECK:          </array>
>> +// CHECK:         <key>end</key>
>> +// CHECK:          <array>
>> +// CHECK:           <dict>
>> +// CHECK:            <key>line</key><integer>77</integer>
>> +// CHECK:            <key>col</key><integer>3</integer>
>> +// CHECK:            <key>file</key><integer>0</integer>
>> +// CHECK:           </dict>
>> +// CHECK:           <dict>
>> +// CHECK:            <key>line</key><integer>77</integer>
>> +// CHECK:            <key>col</key><integer>5</integer>
>> +// CHECK:            <key>file</key><integer>0</integer>
>> +// CHECK:           </dict>
>> +// CHECK:          </array>
>> +// CHECK:        </dict>
>> +// CHECK:       </array>
>> +// CHECK:     </dict>
>> +// CHECK:     <dict>
>> +// CHECK:      <key>kind</key><string>event</string>
>> +// CHECK:      <key>location</key>
>> +// CHECK:      <dict>
>> +// CHECK:       <key>line</key><integer>77</integer>
>> +// CHECK:       <key>col</key><integer>3</integer>
>> +// CHECK:       <key>file</key><integer>0</integer>
>> +// CHECK:      </dict>
>> +// CHECK:      <key>ranges</key>
>> +// CHECK:      <array>
>> +// CHECK:        <array>
>> +// CHECK:         <dict>
>> +// CHECK:          <key>line</key><integer>77</integer>
>> +// CHECK:          <key>col</key><integer>3</integer>
>> +// CHECK:          <key>file</key><integer>0</integer>
>> +// CHECK:         </dict>
>> +// CHECK:         <dict>
>> +// CHECK:          <key>line</key><integer>77</integer>
>> +// CHECK:          <key>col</key><integer>8</integer>
>> +// CHECK:          <key>file</key><integer>0</integer>
>> +// CHECK:         </dict>
>> +// CHECK:        </array>
>> +// CHECK:      </array>
>> +// CHECK:      <key>depth</key><integer>0</integer>
>> +// CHECK:      <key>extended_message</key>
>> +// CHECK:      <string>Variable 'a' initialized to a null pointer value</string>
>> +// CHECK:      <key>message</key>
>> +// CHECK: <string>Variable 'a' initialized to a null pointer value</string>
>> +// CHECK:     </dict>
>> +// CHECK:     <dict>
>> +// CHECK:      <key>kind</key><string>control</string>
>> +// CHECK:      <key>edges</key>
>> +// CHECK:       <array>
>> +// CHECK:        <dict>
>> +// CHECK:         <key>start</key>
>> +// CHECK:          <array>
>> +// CHECK:           <dict>
>> +// CHECK:            <key>line</key><integer>77</integer>
>> +// CHECK:            <key>col</key><integer>3</integer>
>> +// CHECK:            <key>file</key><integer>0</integer>
>> +// CHECK:           </dict>
>> +// CHECK:           <dict>
>> +// CHECK:            <key>line</key><integer>77</integer>
>> +// CHECK:            <key>col</key><integer>5</integer>
>> +// CHECK:            <key>file</key><integer>0</integer>
>> +// CHECK:           </dict>
>> +// CHECK:          </array>
>> +// CHECK:         <key>end</key>
>> +// CHECK:          <array>
>> +// CHECK:           <dict>
>> +// CHECK:            <key>line</key><integer>79</integer>
>> +// CHECK:            <key>col</key><integer>3</integer>
>> +// CHECK:            <key>file</key><integer>0</integer>
>> +// CHECK:           </dict>
>> +// CHECK:           <dict>
>> +// CHECK:            <key>line</key><integer>79</integer>
>> +// CHECK:            <key>col</key><integer>3</integer>
>> +// CHECK:            <key>file</key><integer>0</integer>
>> +// CHECK:           </dict>
>> +// CHECK:          </array>
>> +// CHECK:        </dict>
>> +// CHECK:       </array>
>> +// CHECK:     </dict>
>> +// CHECK:     <dict>
>> +// CHECK:      <key>kind</key><string>event</string>
>> +// CHECK:      <key>location</key>
>> +// CHECK:      <dict>
>> +// CHECK:       <key>line</key><integer>79</integer>
>> +// CHECK:       <key>col</key><integer>3</integer>
>> +// CHECK:       <key>file</key><integer>0</integer>
>> +// CHECK:      </dict>
>> +// CHECK:      <key>ranges</key>
>> +// CHECK:      <array>
>> +// CHECK:        <array>
>> +// CHECK:         <dict>
>> +// CHECK:          <key>line</key><integer>79</integer>
>> +// CHECK:          <key>col</key><integer>4</integer>
>> +// CHECK:          <key>file</key><integer>0</integer>
>> +// CHECK:         </dict>
>> +// CHECK:         <dict>
>> +// CHECK:          <key>line</key><integer>79</integer>
>> +// CHECK:          <key>col</key><integer>4</integer>
>> +// CHECK:          <key>file</key><integer>0</integer>
>> +// CHECK:         </dict>
>> +// CHECK:        </array>
>> +// CHECK:      </array>
>> +// CHECK:      <key>depth</key><integer>0</integer>
>> +// CHECK:      <key>extended_message</key>
>> +// CHECK:      <string>Dereference of null pointer (loaded from variable 'a')</string>
>> +// CHECK:      <key>message</key>
>> +// CHECK: <string>Dereference of null pointer (loaded from variable 'a')</string>
>> +// CHECK:     </dict>
>> +// CHECK:    </array>
>> +// CHECK:    <key>description</key><string>Dereference of null pointer (loaded from variable 'a')</string>
>> +// CHECK:    <key>category</key><string>Logic error</string>
>> +// CHECK:    <key>type</key><string>Dereference of null pointer</string>
>> +// CHECK:   <key>issue_context_kind</key><string>function</string>
>> +// CHECK:   <key>issue_context</key><string>testInitZero</string>
>> +// CHECK:   <key>issue_hash</key><integer>4</integer>
>> +// CHECK:   <key>location</key>
>> +// CHECK:   <dict>
>> +// CHECK:    <key>line</key><integer>79</integer>
>> +// CHECK:    <key>col</key><integer>3</integer>
>> +// CHECK:    <key>file</key><integer>0</integer>
>> +// CHECK:   </dict>
>> +// CHECK:   </dict>
>> +// CHECK:   <dict>
>> +// CHECK:    <key>path</key>
>> +// CHECK:    <array>
>> +// CHECK:     <dict>
>> +// CHECK:      <key>kind</key><string>control</string>
>> +// CHECK:      <key>edges</key>
>> +// CHECK:       <array>
>> +// CHECK:        <dict>
>> +// CHECK:         <key>start</key>
>> +// CHECK:          <array>
>> +// CHECK:           <dict>
>> +// CHECK:            <key>line</key><integer>85</integer>
>> +// CHECK:            <key>col</key><integer>3</integer>
>> +// CHECK:            <key>file</key><integer>0</integer>
>> +// CHECK:           </dict>
>> +// CHECK:           <dict>
>> +// CHECK:            <key>line</key><integer>85</integer>
>> +// CHECK:            <key>col</key><integer>3</integer>
>> +// CHECK:            <key>file</key><integer>0</integer>
>> +// CHECK:           </dict>
>> +// CHECK:          </array>
>> +// CHECK:         <key>end</key>
>> +// CHECK:          <array>
>> +// CHECK:           <dict>
>> +// CHECK:            <key>line</key><integer>85</integer>
>> +// CHECK:            <key>col</key><integer>7</integer>
>> +// CHECK:            <key>file</key><integer>0</integer>
>> +// CHECK:           </dict>
>> +// CHECK:           <dict>
>> +// CHECK:            <key>line</key><integer>85</integer>
>> +// CHECK:            <key>col</key><integer>13</integer>
>> +// CHECK:            <key>file</key><integer>0</integer>
>> +// CHECK:           </dict>
>> +// CHECK:          </array>
>> +// CHECK:        </dict>
>> +// CHECK:       </array>
>> +// CHECK:     </dict>
>> +// CHECK:     <dict>
>> +// CHECK:      <key>kind</key><string>control</string>
>> +// CHECK:      <key>edges</key>
>> +// CHECK:       <array>
>> +// CHECK:        <dict>
>> +// CHECK:         <key>start</key>
>> +// CHECK:          <array>
>> +// CHECK:           <dict>
>> +// CHECK:            <key>line</key><integer>85</integer>
>> +// CHECK:            <key>col</key><integer>3</integer>
>> +// CHECK:            <key>file</key><integer>0</integer>
>> +// CHECK:           </dict>
>> +// CHECK:           <dict>
>> +// CHECK:            <key>line</key><integer>85</integer>
>> +// CHECK:            <key>col</key><integer>3</integer>
>> +// CHECK:            <key>file</key><integer>0</integer>
>> +// CHECK:           </dict>
>> +// CHECK:          </array>
>> +// CHECK:         <key>end</key>
>> +// CHECK:          <array>
>> +// CHECK:           <dict>
>> +// CHECK:            <key>line</key><integer>85</integer>
>> +// CHECK:            <key>col</key><integer>7</integer>
>> +// CHECK:            <key>file</key><integer>0</integer>
>> +// CHECK:           </dict>
>> +// CHECK:           <dict>
>> +// CHECK:            <key>line</key><integer>85</integer>
>> +// CHECK:            <key>col</key><integer>13</integer>
>> +// CHECK:            <key>file</key><integer>0</integer>
>> +// CHECK:           </dict>
>> +// CHECK:          </array>
>> +// CHECK:        </dict>
>> +// CHECK:       </array>
>> +// CHECK:     </dict>
>> +// CHECK:     <dict>
>> +// CHECK:      <key>kind</key><string>control</string>
>> +// CHECK:      <key>edges</key>
>> +// CHECK:       <array>
>> +// CHECK:        <dict>
>> +// CHECK:         <key>start</key>
>> +// CHECK:          <array>
>> +// CHECK:           <dict>
>> +// CHECK:            <key>line</key><integer>85</integer>
>> +// CHECK:            <key>col</key><integer>7</integer>
>> +// CHECK:            <key>file</key><integer>0</integer>
>> +// CHECK:           </dict>
>> +// CHECK:           <dict>
>> +// CHECK:            <key>line</key><integer>85</integer>
>> +// CHECK:            <key>col</key><integer>13</integer>
>> +// CHECK:            <key>file</key><integer>0</integer>
>> +// CHECK:           </dict>
>> +// CHECK:          </array>
>> +// CHECK:         <key>end</key>
>> +// CHECK:          <array>
>> +// CHECK:           <dict>
>> +// CHECK:            <key>line</key><integer>85</integer>
>> +// CHECK:            <key>col</key><integer>3</integer>
>> +// CHECK:            <key>file</key><integer>0</integer>
>> +// CHECK:           </dict>
>> +// CHECK:           <dict>
>> +// CHECK:            <key>line</key><integer>85</integer>
>> +// CHECK:            <key>col</key><integer>3</integer>
>> +// CHECK:            <key>file</key><integer>0</integer>
>> +// CHECK:           </dict>
>> +// CHECK:          </array>
>> +// CHECK:        </dict>
>> +// CHECK:       </array>
>> +// CHECK:     </dict>
>> +// CHECK:     <dict>
>> +// CHECK:      <key>kind</key><string>event</string>
>> +// CHECK:      <key>location</key>
>> +// CHECK:      <dict>
>> +// CHECK:       <key>line</key><integer>85</integer>
>> +// CHECK:       <key>col</key><integer>3</integer>
>> +// CHECK:       <key>file</key><integer>0</integer>
>> +// CHECK:      </dict>
>> +// CHECK:      <key>ranges</key>
>> +// CHECK:      <array>
>> +// CHECK:        <array>
>> +// CHECK:         <dict>
>> +// CHECK:          <key>line</key><integer>85</integer>
>> +// CHECK:          <key>col</key><integer>3</integer>
>> +// CHECK:          <key>file</key><integer>0</integer>
>> +// CHECK:         </dict>
>> +// CHECK:         <dict>
>> +// CHECK:          <key>line</key><integer>85</integer>
>> +// CHECK:          <key>col</key><integer>15</integer>
>> +// CHECK:          <key>file</key><integer>0</integer>
>> +// CHECK:         </dict>
>> +// CHECK:        </array>
>> +// CHECK:      </array>
>> +// CHECK:      <key>depth</key><integer>0</integer>
>> +// CHECK:      <key>extended_message</key>
>> +// CHECK:      <string>Null pointer value stored to 'a'</string>
>> +// CHECK:      <key>message</key>
>> +// CHECK: <string>Null pointer value stored to 'a'</string>
>> +// CHECK:     </dict>
>> +// CHECK:     <dict>
>> +// CHECK:      <key>kind</key><string>control</string>
>> +// CHECK:      <key>edges</key>
>> +// CHECK:       <array>
>> +// CHECK:        <dict>
>> +// CHECK:         <key>start</key>
>> +// CHECK:          <array>
>> +// CHECK:           <dict>
>> +// CHECK:            <key>line</key><integer>85</integer>
>> +// CHECK:            <key>col</key><integer>3</integer>
>> +// CHECK:            <key>file</key><integer>0</integer>
>> +// CHECK:           </dict>
>> +// CHECK:           <dict>
>> +// CHECK:            <key>line</key><integer>85</integer>
>> +// CHECK:            <key>col</key><integer>3</integer>
>> +// CHECK:            <key>file</key><integer>0</integer>
>> +// CHECK:           </dict>
>> +// CHECK:          </array>
>> +// CHECK:         <key>end</key>
>> +// CHECK:          <array>
>> +// CHECK:           <dict>
>> +// CHECK:            <key>line</key><integer>87</integer>
>> +// CHECK:            <key>col</key><integer>3</integer>
>> +// CHECK:            <key>file</key><integer>0</integer>
>> +// CHECK:           </dict>
>> +// CHECK:           <dict>
>> +// CHECK:            <key>line</key><integer>87</integer>
>> +// CHECK:            <key>col</key><integer>3</integer>
>> +// CHECK:            <key>file</key><integer>0</integer>
>> +// CHECK:           </dict>
>> +// CHECK:          </array>
>> +// CHECK:        </dict>
>> +// CHECK:       </array>
>> +// CHECK:     </dict>
>> +// CHECK:     <dict>
>> +// CHECK:      <key>kind</key><string>event</string>
>> +// CHECK:      <key>location</key>
>> +// CHECK:      <dict>
>> +// CHECK:       <key>line</key><integer>87</integer>
>> +// CHECK:       <key>col</key><integer>3</integer>
>> +// CHECK:       <key>file</key><integer>0</integer>
>> +// CHECK:      </dict>
>> +// CHECK:      <key>ranges</key>
>> +// CHECK:      <array>
>> +// CHECK:        <array>
>> +// CHECK:         <dict>
>> +// CHECK:          <key>line</key><integer>87</integer>
>> +// CHECK:          <key>col</key><integer>4</integer>
>> +// CHECK:          <key>file</key><integer>0</integer>
>> +// CHECK:         </dict>
>> +// CHECK:         <dict>
>> +// CHECK:          <key>line</key><integer>87</integer>
>> +// CHECK:          <key>col</key><integer>4</integer>
>> +// CHECK:          <key>file</key><integer>0</integer>
>> +// CHECK:         </dict>
>> +// CHECK:        </array>
>> +// CHECK:      </array>
>> +// CHECK:      <key>depth</key><integer>0</integer>
>> +// CHECK:      <key>extended_message</key>
>> +// CHECK:      <string>Dereference of null pointer (loaded from variable 'a')</string>
>> +// CHECK:      <key>message</key>
>> +// CHECK: <string>Dereference of null pointer (loaded from variable 'a')</string>
>> +// CHECK:     </dict>
>> +// CHECK:    </array>
>> +// CHECK:    <key>description</key><string>Dereference of null pointer (loaded from variable 'a')</string>
>> +// CHECK:    <key>category</key><string>Logic error</string>
>> +// CHECK:    <key>type</key><string>Dereference of null pointer</string>
>> +// CHECK:   <key>issue_context_kind</key><string>function</string>
>> +// CHECK:   <key>issue_context</key><string>testStoreZero</string>
>> +// CHECK:   <key>issue_hash</key><integer>4</integer>
>> +// CHECK:   <key>location</key>
>> +// CHECK:   <dict>
>> +// CHECK:    <key>line</key><integer>87</integer>
>> +// CHECK:    <key>col</key><integer>3</integer>
>> +// CHECK:    <key>file</key><integer>0</integer>
>> +// CHECK:   </dict>
>> +// CHECK:   </dict>
>> // CHECK:  </array>
>> // CHECK: </dict>
>> // CHECK: </plist>
>> 
>> 
>> _______________________________________________
>> cfe-commits mailing list
>> cfe-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
> 




More information about the cfe-commits mailing list