summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorDevin Coughlin <dcoughlin@apple.com>2016-02-08 00:28:24 +0000
committerDevin Coughlin <dcoughlin@apple.com>2016-02-08 00:28:24 +0000
commit480a0c00ca51d909a925120737b71289cbb79eda (patch)
tree210b82bfd5b8231de0512144f936d10f30cf5012 /clang/lib
parentf1d54eb222d3b1dba50643473d4c77ea0f026915 (diff)
downloadbcm5719-llvm-480a0c00ca51d909a925120737b71289cbb79eda.tar.gz
bcm5719-llvm-480a0c00ca51d909a925120737b71289cbb79eda.zip
[analyzer] Avoid crash when attempting to evaluate binary operation on LazyCompoundVal.
Instead, return UnknownValue if either operand is a nonloc::LazyCompoundVal. This is a spot fix for PR 24951. rdar://problem/23682244 llvm-svn: 260066
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/StaticAnalyzer/Core/SValBuilder.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/SValBuilder.cpp b/clang/lib/StaticAnalyzer/Core/SValBuilder.cpp
index 22bc14edd68..72bcdd9ecb0 100644
--- a/clang/lib/StaticAnalyzer/Core/SValBuilder.cpp
+++ b/clang/lib/StaticAnalyzer/Core/SValBuilder.cpp
@@ -367,6 +367,11 @@ SVal SValBuilder::evalBinOp(ProgramStateRef state, BinaryOperator::Opcode op,
if (lhs.isUnknown() || rhs.isUnknown())
return UnknownVal();
+ if (lhs.getAs<nonloc::LazyCompoundVal>() ||
+ rhs.getAs<nonloc::LazyCompoundVal>()) {
+ return UnknownVal();
+ }
+
if (Optional<Loc> LV = lhs.getAs<Loc>()) {
if (Optional<Loc> RV = rhs.getAs<Loc>())
return evalBinOpLL(state, op, *LV, *RV, type);
OpenPOWER on IntegriCloud