aboutsummaryrefslogtreecommitdiff
path: root/lib/StaticAnalyzer/Checkers/UndefResultChecker.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
commit80de487e03dd0f44e4572e2122ebc1aa6a3961f5 (patch)
tree4388c41e6efe5f7600ba369e668d157102adf1a1 /lib/StaticAnalyzer/Checkers/UndefResultChecker.cpp
parenta484fc73ec6331bcaad092270b4ab9c8d1df23c3 (diff)
[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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162863 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Checkers/UndefResultChecker.cpp')
-rw-r--r--lib/StaticAnalyzer/Checkers/UndefResultChecker.cpp1
1 files changed, 0 insertions, 1 deletions
diff --git a/lib/StaticAnalyzer/Checkers/UndefResultChecker.cpp b/lib/StaticAnalyzer/Checkers/UndefResultChecker.cpp
index 605f6775f9..bbfff0cdc3 100644
--- a/lib/StaticAnalyzer/Checkers/UndefResultChecker.cpp
+++ b/lib/StaticAnalyzer/Checkers/UndefResultChecker.cpp
@@ -81,7 +81,6 @@ void UndefResultChecker::checkPostStmt(const BinaryOperator *B,
else
bugreporter::trackNullOrUndefValue(N, B, *report);
- report->disablePathPruning();
C.EmitReport(report);
}
}