aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2012-08-29 23:23:39 +0000
committerAnna Zaks <ganna@apple.com>2012-08-29 23:23:39 +0000
commit28694c1fe44082970cd53ca7ffef25f668e4c545 (patch)
tree000eafbc91b044e4511768c3ba351dce4deb68f0
parent9af9122067f1334806a5f22ce907a3209490d506 (diff)
[analyzer] Fixup 162863.
Thanks Jordan. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162875 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/StaticAnalyzer/Core/BugReporterVisitors.cpp6
-rw-r--r--test/Analysis/diagnostics/undef-value-param.c4
-rwxr-xr-xutils/analyzer/SATestBuild.py3
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))