Files
rust/tests
Jacob Pratt 0649c3f5d5 Rollup merge of #155249 - hoodmane:wasm-panic-in-cleanup-reland, r=bjorn3
Fix: On wasm targets, call `panic_in_cleanup` if panic occurs in cleanup

Relies on https://github.com/rust-lang/llvm-project/pull/194.
Reland of https://github.com/rust-lang/rust/pull/151771.

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.

Rather than using a catchswitch/catchpad pair, I used a cleanuppad. The reason for the pair is to avoid catching foreign exceptions on MSVC. On wasm, it seems that the catchswitch/catchpad pair is optimized back into a single cleanuppad and a catch_all instruction is emitted which will catch foreign exceptions. Because the new logic is only used on wasm, it seemed better to take the simpler approach seeing as they do the same thing.

- [ ] Add test for https://github.com/rust-lang/rust/issues/153948
2026-04-30 22:28:24 -04:00
..
2026-04-19 18:27:10 +02:00