Blockaddresses refer to the function itself, therefore replacing them would cause an assertion in doRAUW.
Fixes https://bugs.llvm.org/show_bug.cgi?id=35201
This was found when trying CFI on a proprietary kernel by Dmitry Mikulin.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
| lib/IR/Value.cpp | ||
|---|---|---|
| 464 ↗ | (On Diff #121777) | Can this line just be |
| test/Transforms/LowerTypeTests/blockaddress.ll | ||
| 16 ↗ | (On Diff #121777) | I think this test case is more complicated than it needs to be. This seems to be enough to trigger the bug: target triple = "x86_64-unknown-linux"
define void @f1() {
entry:
%0 = call i1 @llvm.type.test(i8* bitcast (i8* ()* @f2 to i8*), metadata !"_ZTSFvP3bioE")
ret void
}
declare i1 @llvm.type.test(i8*, metadata)
define i8* @f2() !type !5 {
br label %b
b:
ret i8* blockaddress(@f2, %b)
}
!5 = !{i64 0, !"_ZTSFvP3bioE"}The only important part of the output is the body of f2, so I would only have CHECK lines for that. |