summaryrefslogtreecommitdiff
path: root/lib/StaticAnalyzer/Core/BasicValueFactory.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-12-18 20:11:37 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-12-18 20:11:37 +0000
commit461a67fa15370a9ec88f8f8a240bf7c123bb2029 (patch)
tree6942083d7d56bba40ec790a453ca58ad3baf6832 /lib/StaticAnalyzer/Core/BasicValueFactory.cpp
parent75c3240472ba6ac2669ee72ca67eb72d4e2851fc (diff)
Diffstat (limited to 'lib/StaticAnalyzer/Core/BasicValueFactory.cpp')
-rw-r--r--lib/StaticAnalyzer/Core/BasicValueFactory.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/StaticAnalyzer/Core/BasicValueFactory.cpp b/lib/StaticAnalyzer/Core/BasicValueFactory.cpp
index ebbace4e33b3..ec7a7e9e4b1c 100644
--- a/lib/StaticAnalyzer/Core/BasicValueFactory.cpp
+++ b/lib/StaticAnalyzer/Core/BasicValueFactory.cpp
@@ -225,6 +225,8 @@ BasicValueFactory::evalAPSInt(BinaryOperator::Opcode Op,
// test these conditions symbolically.
// FIXME: Expand these checks to include all undefined behavior.
+ if (V1.isSigned() && V1.isNegative())
+ return nullptr;
if (V2.isSigned() && V2.isNegative())
return nullptr;