diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2012-10-19 17:53:54 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2012-10-19 17:53:54 +0000 |
commit | 7182126b0f3100cfddfbe6939be1a7eaeaf9fd57 (patch) | |
tree | 826a81a559510bbb9bfad69d680f5ba0af3cbf9a /test/Transforms/IndVarSimplify/crash.ll | |
parent | de7c37efe2af87377ad3cdc707c61c0fa02c4038 (diff) | |
download | external_llvm-7182126b0f3100cfddfbe6939be1a7eaeaf9fd57.zip external_llvm-7182126b0f3100cfddfbe6939be1a7eaeaf9fd57.tar.gz external_llvm-7182126b0f3100cfddfbe6939be1a7eaeaf9fd57.tar.bz2 |
Indvars: Don't recursively delete instruction during BB iteration.
This can invalidate the iterators leading to use after frees and crashes.
Fixes PR12536.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166291 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/IndVarSimplify/crash.ll')
-rw-r--r-- | test/Transforms/IndVarSimplify/crash.ll | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/Transforms/IndVarSimplify/crash.ll b/test/Transforms/IndVarSimplify/crash.ll index 62af42b..1b702a3 100644 --- a/test/Transforms/IndVarSimplify/crash.ll +++ b/test/Transforms/IndVarSimplify/crash.ll @@ -113,3 +113,21 @@ bb9: ret void } +; PR12536 +define void @fn1() noreturn nounwind { +entry: + br label %for.cond + +for.cond: ; preds = %for.end, %entry + %b.0 = phi i32 [ undef, %entry ], [ %conv, %for.end ] + br label %for.cond1 + +for.cond1: ; preds = %for.cond1, %for.cond + %c.0 = phi i32 [ %b.0, %for.cond1 ], [ 0, %for.cond ] + br i1 undef, label %for.cond1, label %for.end + +for.end: ; preds = %for.cond1 + %cmp2 = icmp slt i32 %c.0, 1 + %conv = zext i1 %cmp2 to i32 + br label %for.cond +} |