summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis
diff options
context:
space:
mode:
authorDevin Coughlin <dcoughlin@apple.com>2015-09-22 20:31:19 +0000
committerDevin Coughlin <dcoughlin@apple.com>2015-09-22 20:31:19 +0000
commiteb538abfbd0840b7815fb292fcdd0cb5a2042de6 (patch)
tree8434c1d8d18b4e0e2f8bb6581e0e8998a8105f6f /clang/lib/Analysis
parent8c21fad1e88ad43a0db63b35b5793f09f1b21699 (diff)
downloadbcm5719-llvm-eb538abfbd0840b7815fb292fcdd0cb5a2042de6.tar.gz
bcm5719-llvm-eb538abfbd0840b7815fb292fcdd0cb5a2042de6.zip
[analyzer] Create one state for a range switch case instead of multiple.
This fixes PR16833, in which the analyzer was using large amounts of memory for switch statements with large case ranges. rdar://problem/14685772 A patch by Aleksei Sidorin! Differential Revision: http://reviews.llvm.org/D5102 llvm-svn: 248318
Diffstat (limited to 'clang/lib/Analysis')
-rw-r--r--clang/lib/Analysis/CFG.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Analysis/CFG.cpp b/clang/lib/Analysis/CFG.cpp
index efc93534ed1..2a988c6262e 100644
--- a/clang/lib/Analysis/CFG.cpp
+++ b/clang/lib/Analysis/CFG.cpp
@@ -3101,11 +3101,11 @@ static bool shouldAddCase(bool &switchExclusivelyCovered,
addCase = true;
switchExclusivelyCovered = true;
}
- else if (condInt < lhsInt) {
+ else if (condInt > lhsInt) {
if (const Expr *RHS = CS->getRHS()) {
// Evaluate the RHS of the case value.
const llvm::APSInt &V2 = RHS->EvaluateKnownConstInt(Ctx);
- if (V2 <= condInt) {
+ if (V2 >= condInt) {
addCase = true;
switchExclusivelyCovered = true;
}
OpenPOWER on IntegriCloud