mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-19 02:52:53 +02:00
Add a lint check for indirectbr with no successors.
llvm-svn: 110074
This commit is contained in:
parent
f18faa5945
commit
abb2503036
@ -519,6 +519,9 @@ void Lint::visitVAArgInst(VAArgInst &I) {
|
||||
|
||||
void Lint::visitIndirectBrInst(IndirectBrInst &I) {
|
||||
visitMemoryReference(I, I.getAddress(), ~0u, 0, 0, MemRef::Branchee);
|
||||
|
||||
Assert1(I.getNumDestinations() != 0,
|
||||
"Undefined behavior: indirectbr with no destinations", &I);
|
||||
}
|
||||
|
||||
void Lint::visitExtractElementInst(ExtractElementInst &I) {
|
||||
|
@ -161,5 +161,7 @@ declare i32 @nonstruct_callee() nounwind
|
||||
define void @struct_caller() nounwind {
|
||||
entry:
|
||||
call %struct bitcast (i32 ()* @foo to %struct ()*)()
|
||||
ret void
|
||||
|
||||
; CHECK: Undefined behavior: indirectbr with no destinations
|
||||
indirectbr i8* null, []
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user