summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp
diff options
context:
space:
mode:
authorJordy Rose <jediknil@belkadan.com>2011-06-04 00:04:22 +0000
committerJordy Rose <jediknil@belkadan.com>2011-06-04 00:04:22 +0000
commit63b84be6cb338be9d8ff4323991cd49281b81527 (patch)
tree8443a6b60d226fab225da13907f84e3f4baf86e7 /clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp
parentbe605494ac145704dea6d216e1e4368f71cd5186 (diff)
downloadbcm5719-llvm-63b84be6cb338be9d8ff4323991cd49281b81527.tar.gz
bcm5719-llvm-63b84be6cb338be9d8ff4323991cd49281b81527.zip
[analyzer] Fix handling of "copy zero bytes" for memcpy and friends.
llvm-svn: 132607
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp
index 0eec34a9b49..e40567c6c6a 100644
--- a/clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp
@@ -713,16 +713,13 @@ void CStringChecker::evalCopyCommon(CheckerContext &C,
// If the size is zero, there won't be any actual memory access, so
// just bind the return value to the destination buffer and return.
if (stateZeroSize) {
+ stateZeroSize = stateZeroSize->BindExpr(CE, destVal);
C.addTransition(stateZeroSize);
- if (IsMempcpy)
- state->BindExpr(CE, destVal);
- else
- state->BindExpr(CE, sizeVal);
- return;
}
// If the size can be nonzero, we have to check the other arguments.
if (stateNonZeroSize) {
+ state = stateNonZeroSize;
// Ensure the destination is not null. If it is NULL there will be a
// NULL pointer dereference.
OpenPOWER on IntegriCloud