summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Checkers/UndefinedAssignmentChecker.cpp
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2012-08-29 21:22:37 +0000
committerAnna Zaks <ganna@apple.com>2012-08-29 21:22:37 +0000
commit5d4ec363230baabb610194c269af3e1742d9c375 (patch)
tree6b0f67d2d41b85432fcfca8c65dcace992019a31 /clang/lib/StaticAnalyzer/Checkers/UndefinedAssignmentChecker.cpp
parent504f9a28720195940ac7da421948a3b4c8fb221e (diff)
downloadbcm5719-llvm-5d4ec363230baabb610194c269af3e1742d9c375.tar.gz
bcm5719-llvm-5d4ec363230baabb610194c269af3e1742d9c375.zip
[analyzer] Improved diagnostic pruning for calls initializing values.
This heuristic addresses the case when a pointer (or ref) is passed to a function, which initializes the variable (or sets it to something other than '0'). On the branch where the inlined function does not set the value, we report use of undefined value (or NULL pointer dereference). The access happens in the caller and the path through the callee would get pruned away with regular path pruning. To solve this issue, we previously disabled diagnostic pruning completely on undefined and null pointer dereference checks, which entailed very verbose diagnostics in most cases. Furthermore, not all of the undef value checks had the diagnostic pruning disabled. This patch implements the following heuristic: if we pass a pointer (or ref) to the region (on which the error is reported) into a function and it's value is either undef or 'NULL' (and is a pointer), do not prune the function. llvm-svn: 162863
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/UndefinedAssignmentChecker.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Checkers/UndefinedAssignmentChecker.cpp1
1 files changed, 0 insertions, 1 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/UndefinedAssignmentChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/UndefinedAssignmentChecker.cpp
index 8ae75eaaea6..021364bde85 100644
--- a/clang/lib/StaticAnalyzer/Checkers/UndefinedAssignmentChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/UndefinedAssignmentChecker.cpp
@@ -80,7 +80,6 @@ void UndefinedAssignmentChecker::checkBind(SVal location, SVal val,
R->addRange(ex->getSourceRange());
bugreporter::trackNullOrUndefValue(N, ex, *R);
}
- R->disablePathPruning();
C.EmitReport(R);
}
OpenPOWER on IntegriCloud