Fix unreachable code heuristic for conditionals
This commit is contained in:
parent
735dfc7d96
commit
c15a4b3ec7
@ -515,12 +515,18 @@ impl<'a> Builder<'a> {
|
|||||||
Instruction::Block(_) | Instruction::Loop(_) | Instruction::If(_) => {
|
Instruction::Block(_) | Instruction::Loop(_) | Instruction::If(_) => {
|
||||||
self.nested_unreachable += 1;
|
self.nested_unreachable += 1;
|
||||||
}
|
}
|
||||||
Instruction::End => {
|
Instruction::Else if self.nested_unreachable == 1 => {
|
||||||
self.nested_unreachable -= 1;
|
self.nested_unreachable -= 1;
|
||||||
|
|
||||||
if self.nested_unreachable == 0 {
|
self.start_else();
|
||||||
self.end_block();
|
}
|
||||||
}
|
Instruction::End if self.nested_unreachable == 1 => {
|
||||||
|
self.nested_unreachable -= 1;
|
||||||
|
|
||||||
|
self.end_block();
|
||||||
|
}
|
||||||
|
Instruction::End => {
|
||||||
|
self.nested_unreachable -= 1;
|
||||||
}
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user