summaryrefslogtreecommitdiffstats
path: root/polly/lib/Analysis/ScopInfo.cpp
diff options
context:
space:
mode:
authorJohannes Doerfert <doerfert@cs.uni-saarland.de>2016-05-10 14:01:21 +0000
committerJohannes Doerfert <doerfert@cs.uni-saarland.de>2016-05-10 14:01:21 +0000
commitede4ecaefb087126a68a5380ec60e107fe8cc022 (patch)
tree811ab3dc192849aaa0f65ae2e548d1563fb5a537 /polly/lib/Analysis/ScopInfo.cpp
parent2b92a0e4ee7c9e1429f5b63b242295055fb95d4b (diff)
downloadbcm5719-llvm-ede4ecaefb087126a68a5380ec60e107fe8cc022.tar.gz
bcm5719-llvm-ede4ecaefb087126a68a5380ec60e107fe8cc022.zip
[FIX] Cleanup isl objects prior to early exit
llvm-svn: 269061
Diffstat (limited to 'polly/lib/Analysis/ScopInfo.cpp')
-rw-r--r--polly/lib/Analysis/ScopInfo.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/polly/lib/Analysis/ScopInfo.cpp b/polly/lib/Analysis/ScopInfo.cpp
index 96c4ed90d60..38d402f10b4 100644
--- a/polly/lib/Analysis/ScopInfo.cpp
+++ b/polly/lib/Analysis/ScopInfo.cpp
@@ -1301,12 +1301,15 @@ buildConditionSets(ScopStmt &Stmt, Value *Condition, TerminatorInst *TI,
auto Opcode = BinOp->getOpcode();
assert(Opcode == Instruction::And || Opcode == Instruction::Or);
- if (!buildConditionSets(Stmt, BinOp->getOperand(0), TI, L, Domain,
- ConditionSets))
- return false;
- if (!buildConditionSets(Stmt, BinOp->getOperand(1), TI, L, Domain,
- ConditionSets))
+ bool Valid = buildConditionSets(Stmt, BinOp->getOperand(0), TI, L, Domain,
+ ConditionSets) &&
+ buildConditionSets(Stmt, BinOp->getOperand(1), TI, L, Domain,
+ ConditionSets);
+ if (!Valid) {
+ while (!ConditionSets.empty())
+ isl_set_free(ConditionSets.pop_back_val());
return false;
+ }
isl_set_free(ConditionSets.pop_back_val());
isl_set *ConsCondPart0 = ConditionSets.pop_back_val();
OpenPOWER on IntegriCloud