diff options
| author | Benjamin Kramer <benny.kra@googlemail.com> | 2017-08-03 15:59:37 +0000 |
|---|---|---|
| committer | Benjamin Kramer <benny.kra@googlemail.com> | 2017-08-03 15:59:37 +0000 |
| commit | a73b4108053745f5f1f22c90b6da60473f6990bf (patch) | |
| tree | 7d02f4dd92c84af13a61075d55a98235c2979cf5 /llvm/unittests/Analysis | |
| parent | 3fc1c2365ce3c8778d25c3eadfb84f27f9ec1496 (diff) | |
| download | bcm5719-llvm-a73b4108053745f5f1f22c90b6da60473f6990bf.tar.gz bcm5719-llvm-a73b4108053745f5f1f22c90b6da60473f6990bf.zip | |
Fix use after free in unit test.
llvm-svn: 309952
Diffstat (limited to 'llvm/unittests/Analysis')
| -rw-r--r-- | llvm/unittests/Analysis/ScalarEvolutionTest.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/unittests/Analysis/ScalarEvolutionTest.cpp b/llvm/unittests/Analysis/ScalarEvolutionTest.cpp index d4540834239..3d412f43d27 100644 --- a/llvm/unittests/Analysis/ScalarEvolutionTest.cpp +++ b/llvm/unittests/Analysis/ScalarEvolutionTest.cpp @@ -1000,9 +1000,9 @@ TEST_F(ScalarEvolutionsTest, SCEVExitLimitForgetLoop) { Cond->eraseFromParent(); Builder.SetInsertPoint(L); - Builder.CreateICmp(ICmpInst::ICMP_SLT, Add, ConstantInt::get(T_int64, 2000), - "new.cond"); - Builder.CreateCondBr(Cond, L, Post); + auto *NewCond = Builder.CreateICmp( + ICmpInst::ICMP_SLT, Add, ConstantInt::get(T_int64, 2000), "new.cond"); + Builder.CreateCondBr(NewCond, L, Post); const SCEV *NewEC = SE.getBackedgeTakenCount(Loop); EXPECT_NE(EC, NewEC); } @@ -1081,9 +1081,9 @@ TEST_F(ScalarEvolutionsTest, SCEVExitLimitForgetValue) { Load->eraseFromParent(); Builder.SetInsertPoint(L); - Builder.CreateICmp(ICmpInst::ICMP_SLT, Add, ConstantInt::get(T_int64, 2000), - "new.cond"); - Builder.CreateCondBr(Cond, L, Post); + auto *NewCond = Builder.CreateICmp( + ICmpInst::ICMP_SLT, Add, ConstantInt::get(T_int64, 2000), "new.cond"); + Builder.CreateCondBr(NewCond, L, Post); const SCEV *NewEC = SE.getBackedgeTakenCount(Loop); EXPECT_NE(EC, NewEC); } |

