Declare br_table otherwise ebb as predecessor (#551)
* Declare br_table otherwise ebb as predecessor (fixes #545)
This commit is contained in:
@@ -141,7 +141,10 @@ impl<'short, 'long> InstBuilderBase<'short> for FuncInstBuilder<'short, 'long> {
|
||||
None => {
|
||||
// branch_destination() doesn't detect jump_tables
|
||||
// If jump table we declare all entries successor
|
||||
if let InstructionData::BranchTable { table, .. } = data {
|
||||
if let InstructionData::BranchTable {
|
||||
table, destination, ..
|
||||
} = data
|
||||
{
|
||||
// Unlike all other jumps/branches, jump tables are
|
||||
// capable of having the same successor appear
|
||||
// multiple times, so we must deduplicate.
|
||||
@@ -159,8 +162,13 @@ impl<'short, 'long> InstBuilderBase<'short> for FuncInstBuilder<'short, 'long> {
|
||||
*dest_ebb,
|
||||
self.builder.position.basic_block.unwrap(),
|
||||
inst,
|
||||
)
|
||||
);
|
||||
}
|
||||
self.builder.func_ctx.ssa.declare_ebb_predecessor(
|
||||
destination,
|
||||
self.builder.position.basic_block.unwrap(),
|
||||
inst,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user