Skip to content

Commit 1b01acd

Browse files
authored
Rollup merge of #151771 - hoodmane:wasm-double-panic, r=bjorn3
Fix: On wasm targets, call `panic_in_cleanup` if panic occurs in cleanup Previously this was not correctly implemented. Each funclet may need its own terminate block, so this changes the `terminate_block` into a `terminate_blocks` `IndexVec` which can have a terminate_block for each funclet. We key on the first basic block of the funclet -- in particular, this is the start block for the old case of the top level terminate function. I also fixed the `terminate` handler to not be invoked when a foreign exception is raised, mimicking the behavior from msvc. On wasm, in order to avoid generating a `catch_all` we need to call `llvm.wasm.get.exception` and `llvm.wasm.get.ehselector`.
2 parents 9604a5f + 097b6b3 commit 1b01acd

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/builder.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1655,6 +1655,10 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
16551655
unimplemented!();
16561656
}
16571657

1658+
fn get_funclet_cleanuppad(&self, _funclet: &Funclet) -> RValue<'gcc> {
1659+
unimplemented!();
1660+
}
1661+
16581662
// Atomic Operations
16591663
fn atomic_cmpxchg(
16601664
&mut self,

0 commit comments

Comments
 (0)