summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp
diff options
context:
space:
mode:
authorGeorge Karpenkov <ekarpenkov@apple.com>2018-08-29 20:29:59 +0000
committerGeorge Karpenkov <ekarpenkov@apple.com>2018-08-29 20:29:59 +0000
commit9ff67a9dda045d82f378f0d3427b918da3c60fef (patch)
tree66b1c5bc3ebe31218648b02a1808acd780b39ba8 /clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp
parenteae57a2b13dd2898806df0adf0b76274cd900d37 (diff)
downloadbcm5719-llvm-9ff67a9dda045d82f378f0d3427b918da3c60fef.tar.gz
bcm5719-llvm-9ff67a9dda045d82f378f0d3427b918da3c60fef.zip
[analyzer] Resolve the crash in ReturnUndefChecker
By making sure the returned value from getKnownSVal is consistent with the value used inside expression engine. PR38427 Differential Revision: https://reviews.llvm.org/D51252 llvm-svn: 340965
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp b/clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp
index 00cf067d31b..36a0f4e6d8c 100644
--- a/clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp
+++ b/clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp
@@ -1201,6 +1201,7 @@ SVal SimpleSValBuilder::evalBinOpLN(ProgramStateRef state,
const llvm::APSInt *SimpleSValBuilder::getKnownValue(ProgramStateRef state,
SVal V) {
+ V = simplifySVal(state, V);
if (V.isUnknownOrUndef())
return nullptr;
OpenPOWER on IntegriCloud