Properly legalize with empty jump tables.
This commit is contained in:
committed by
Nicolas B. Pierron
parent
6e57e3f8f3
commit
f0d7438728
@@ -295,9 +295,12 @@ fn expand_br_table_conds(
|
||||
|
||||
// This is a poor man's jump table using just a sequence of conditional branches.
|
||||
let table_size = func.jump_tables[table].len();
|
||||
let mut cond_failed_ebb = std::vec::Vec::with_capacity(table_size - 1);
|
||||
for _ in 0..table_size - 1 {
|
||||
cond_failed_ebb.push(func.dfg.make_ebb());
|
||||
let mut cond_failed_ebb = vec![];
|
||||
if table_size >= 1 {
|
||||
cond_failed_ebb = std::vec::Vec::with_capacity(table_size - 1);
|
||||
for _ in 0..table_size - 1 {
|
||||
cond_failed_ebb.push(func.dfg.make_ebb());
|
||||
}
|
||||
}
|
||||
|
||||
let mut pos = FuncCursor::new(func).at_inst(inst);
|
||||
|
||||
Reference in New Issue
Block a user