Fix: On wasm targets, call panic_in_cleanup if panic occurs in cleanup#155249
Conversation
|
Some changes occurred in compiler/rustc_codegen_gcc |
|
r? @JohnTitor rustbot has assigned @JohnTitor. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
|
r? @bjorn3 |
|
@rustbot blocked LLVM backport and rustc LLVM update need to land first. |
Update LLVM to 22.1.4 Unlocks #155249. I made a new branch that removes CI checks for macOS and reverts rust-lang/llvm-project@24b53fb.
Update LLVM to 22.1.4 Unlocks #155249. I made a new branch that removes CI checks for macOS and reverts rust-lang/llvm-project@24b53fb.
This comment has been minimized.
This comment has been minimized.
Update LLVM to 22.1.4 Unlocks rust-lang/rust#155249. I made a new branch that removes CI checks for macOS and reverts rust-lang/llvm-project@24b53fb.
Update LLVM to 22.1.4 Unlocks rust-lang/rust#155249. I made a new branch that removes CI checks for macOS and reverts rust-lang/llvm-project@24b53fb.
This comment has been minimized.
This comment has been minimized.
|
@bors author The backport has happened. |
|
Unknown command "author". Run |
|
@rustbot author |
|
Reminder, once the PR becomes ready for a review, use |
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.
9664e4c to
b072d24
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
@rustbot ready |
Update LLVM to 22.1.4 Unlocks rust-lang/rust#155249. I made a new branch that removes CI checks for macOS and reverts rust-lang/llvm-project@24b53fb.
|
@bors r+ |
…and, r=bjorn3 Fix: On wasm targets, call `panic_in_cleanup` if panic occurs in cleanup Relies on rust-lang/llvm-project#194. Reland of rust-lang#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 rust-lang#153948
…uwer Rollup of 13 pull requests Successful merges: - #155249 (Fix: On wasm targets, call `panic_in_cleanup` if panic occurs in cleanup) - #155853 (Use `_mcount` as the mcount symbol name on RISC-V Linux GNU targets) - #155919 (simplify `ast_fragments!`) - #155939 (Add feature gate for view_types experiment) - #155974 (add `c_variadic_experimental_arch` feature) - #155991 (Catch unwinds from the global ctxt callback to complete queries profiling data in more cases) - #156003 (Pass Session to optimize_and_codegen_fat_lto) - #153566 (Add suggestion for E0401 on inner const items) - #154610 (Suggest public re-exports when a private module makes an import path inaccessible) - #155523 (Reorganize `tests/ui/issues/` - 02) - #155980 (Move `feature*` methods from `parse` mod to `errors` mod.) - #155987 (Make lifting infallible) - #155988 (tests/run-make/print-cfg: add Android target_env case)
Rollup of 19 pull requests Successful merges: - #155237 (Disentangle AST crates and error crates) - #155249 (Fix: On wasm targets, call `panic_in_cleanup` if panic occurs in cleanup) - #155853 (Use `_mcount` as the mcount symbol name on RISC-V Linux GNU targets) - #155919 (simplify `ast_fragments!`) - #155939 (Add feature gate for view_types experiment) - #155954 (rustdoc: preserve parent doc cfg for `macro_export` macros) - #155974 (add `c_variadic_experimental_arch` feature) - #155991 (Catch unwinds from the global ctxt callback to complete queries profiling data in more cases) - #156003 (Pass Session to optimize_and_codegen_fat_lto) - #153566 (Add suggestion for E0401 on inner const items) - #154610 (Suggest public re-exports when a private module makes an import path inaccessible) - #155523 (Reorganize `tests/ui/issues/` - 02) - #155821 (c-variadic: document `Clone` and `Drop` instances and require `VaArgSafe: Copy`) - #155980 (Move `feature*` methods from `parse` mod to `errors` mod.) - #155987 (Make lifting infallible) - #155988 (tests/run-make/print-cfg: add Android target_env case) - #156000 (Fix ICE when using -Zinstrument-mcount and -Clinker-flavor=lld) - #156002 (Allow to use `Diagnostic` directly in `SharedContext::emit_lint`) - #156015 (rustc-dev-guide subtree update)
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 rust-lang/llvm-project#194. Reland of #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 #153948
Relies on rust-lang/llvm-project#194.
Reland of #151771.
Previously this was not correctly implemented. Each funclet may need its own terminate block, so this changes the
terminate_blockinto aterminate_blocksIndexVecwhich 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.