From 28694c1fe44082970cd53ca7ffef25f668e4c545 Mon Sep 17 00:00:00 2001 From: Anna Zaks Date: Wed, 29 Aug 2012 23:23:39 +0000 Subject: [PATCH] [analyzer] Fixup 162863. Thanks Jordan. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162875 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/StaticAnalyzer/Core/BugReporterVisitors.cpp | 6 +++--- test/Analysis/diagnostics/undef-value-param.c | 4 ++-- utils/analyzer/SATestBuild.py | 3 --- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp b/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp index 521b727395..358bfdd89c 100644 --- a/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp +++ b/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp @@ -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'. diff --git a/test/Analysis/diagnostics/undef-value-param.c b/test/Analysis/diagnostics/undef-value-param.c index 94fbb11c9e..8eb61c94cf 100644 --- a/test/Analysis/diagnostics/undef-value-param.c +++ b/test/Analysis/diagnostics/undef-value-param.c @@ -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); diff --git a/utils/analyzer/SATestBuild.py b/utils/analyzer/SATestBuild.py index 27a18673a5..bf9153543c 100755 --- a/utils/analyzer/SATestBuild.py +++ b/utils/analyzer/SATestBuild.py @@ -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)) -- 2.40.0