diff options
| author | Dmitry Mikulin <dmitry.mikulin@sony.com> | 2017-11-17 00:30:24 +0000 |
|---|---|---|
| committer | Dmitry Mikulin <dmitry.mikulin@sony.com> | 2017-11-17 00:30:24 +0000 |
| commit | 2f2ace985de421f9a4ff793ae2520ae91ecd4f0a (patch) | |
| tree | 1c3cca3fa7960555f5442b8c3d62c1db2bebff24 /llvm/test/Transforms | |
| parent | 6497193cfe221c51a55983e875bf7744cc859943 (diff) | |
| download | bcm5719-llvm-2f2ace985de421f9a4ff793ae2520ae91ecd4f0a.tar.gz bcm5719-llvm-2f2ace985de421f9a4ff793ae2520ae91ecd4f0a.zip | |
Current implementation of Value::replaceUsesExceptBlockAddr() uses UseList
iterator to walk the list which keeps changing inside the loop. When the
UseList contains several uses with the same user, we end processing the same
user more than once, which leads to an assert.
With this fix, unique users are saved and processed later to avoid
processing duplicates.
Differential Revision: https://reviews.llvm.org/D39864
llvm-svn: 318477
Diffstat (limited to 'llvm/test/Transforms')
| -rw-r--r-- | llvm/test/Transforms/LowerTypeTests/blockaddress-2.ll | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/llvm/test/Transforms/LowerTypeTests/blockaddress-2.ll b/llvm/test/Transforms/LowerTypeTests/blockaddress-2.ll new file mode 100644 index 00000000000..b39a7bc3532 --- /dev/null +++ b/llvm/test/Transforms/LowerTypeTests/blockaddress-2.ll @@ -0,0 +1,26 @@ +; RUN: opt -S %s -lowertypetests | FileCheck %s + +; CHECK: @badfileops = internal global %struct.f { void ()* @bad_f, void ()* @bad_f } +; CHECK: @bad_f = internal alias void (), void ()* @.cfi.jumptable +; CHECK: define internal void @bad_f.cfi() !type !0 { +; CHECK-NEXT: ret void + +target triple = "x86_64-unknown-linux" + +%struct.f = type { void ()*, void ()* } +@badfileops = internal global %struct.f { void ()* @bad_f, void ()* @bad_f }, align 8 + +declare i1 @llvm.type.test(i8*, metadata) + +define internal void @bad_f() !type !1 { + ret void +} + +define internal fastcc void @do_f() unnamed_addr !type !2 { + %1 = tail call i1 @llvm.type.test(i8* undef, metadata !"_ZTSFiP4fileP3uioP5ucrediP6threadE"), !nosanitize !3 + ret void +} + +!1 = !{i64 0, !"_ZTSFiP4fileP3uioP5ucrediP6threadE"} +!2 = !{i64 0, !"_ZTSFiP6threadiP4fileP3uioliE"} +!3 = !{} |

