]> granicus.if.org Git - clang/commitdiff
[analyzer] Fixup 162863.
authorAnna Zaks <ganna@apple.com>
Wed, 29 Aug 2012 23:23:39 +0000 (23:23 +0000)
committerAnna Zaks <ganna@apple.com>
Wed, 29 Aug 2012 23:23:39 +0000 (23:23 +0000)
Thanks Jordan.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162875 91177308-0d34-0410-b5e6-96231b3b80d8

lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
test/Analysis/diagnostics/undef-value-param.c
utils/analyzer/SATestBuild.py

index 521b727395dc2d1ddbe1215f8a1548bcb9c83325..358bfdd89c6d7724a61ddecff62f36dbdb1414f7 100644 (file)
@@ -978,7 +978,7 @@ UndefOrNullArgVisitor::VisitNode(const ExplodedNode *N,
 
     // Are we tracking the argument?
     if ( !ArgReg || ArgReg != R)
-      return 0;
+      continue;
 
     // Check the function parameter type.
     const ParmVarDecl *ParamDecl = *I;
@@ -987,13 +987,13 @@ UndefOrNullArgVisitor::VisitNode(const ExplodedNode *N,
 
     if (!(T->isAnyPointerType() || T->isReferenceType())) {
       // Function can only change the value passed in by address.
-      return 0;
+      continue;
     }
     
     // If it is a const pointer value, the function does not intend to
     // change the value.
     if (T->getPointeeType().isConstQualified())
-      return 0;
+      continue;
 
     // Mark the call site (LocationContext) as interesting if the value of the 
     // argument is undefined or '0'/'NULL'.
index 94fbb11c9e1c07aef1eade1851d940c1f1593c55..8eb61c94cfd04aed598bc7688062de6c82885f06 100644 (file)
@@ -7,7 +7,7 @@ void foo_irrelevant(int c) {
     c++;
     return;
 }
-void foo(int *x, int c) {
+void foo(int c, int *x) {
     if (c)
            //expected-note@-1{{Assuming 'c' is not equal to 0}}
            //expected-note@-2{{Taking true branch}}
@@ -18,7 +18,7 @@ void foo(int *x, int c) {
 int use(int c) {
     int xx; //expected-note{{Variable 'xx' declared without an initial value}}
     int *y = &xx;
-    foo (y, c);
+    foo (c, y);
                 //expected-note@-1{{Calling 'foo'}}
                 //expected-note@-2{{Returning from 'foo'}}
     foo_irrelevant(c);
index 27a18673a5bba31919dde27f922d04b6ca76ee3b..bf9153543c31b5f6e67e019962e6eb970335dff8 100755 (executable)
@@ -404,9 +404,6 @@ def runCmpResults(Dir):
     RefList = glob.glob(RefDir + "/*") 
     NewList = glob.glob(NewDir + "/*")
     
-    print "  Comparing Results: %s" % (os.path.join(RefDir, LogFolderName))
-    print "  Comparing Results: %s" % (os.path.join(NewDir, LogFolderName))
-
     # Log folders are also located in the results dir, so ignore them. 
     RefList.remove(os.path.join(RefDir, LogFolderName))
     NewList.remove(os.path.join(NewDir, LogFolderName))