Fix: On wasm targets, call panic_in_cleanup if panic occurs in cleanup#151771
Open
hoodmane wants to merge 1 commit intorust-lang:mainfrom
Open
Fix: On wasm targets, call panic_in_cleanup if panic occurs in cleanup#151771hoodmane wants to merge 1 commit intorust-lang:mainfrom
panic_in_cleanup if panic occurs in cleanup#151771hoodmane wants to merge 1 commit intorust-lang:mainfrom
Conversation
Collaborator
|
Some changes occurred in compiler/rustc_codegen_gcc |
Collaborator
947c55e to
08e5fd4
Compare
Contributor
Author
|
cc @bjorn3 |
08e5fd4 to
8b1d83b
Compare
Member
|
r? bjorn3 You can roll it back to me, but I think you're a better reviewer for this |
Contributor
Author
|
@bjorn3 would appreciate review on this when you have a chance. |
bjorn3
reviewed
Feb 16, 2026
8b1d83b to
a8104b5
Compare
hoodmane
commented
Feb 16, 2026
This comment has been minimized.
This comment has been minimized.
a8104b5 to
70be469
Compare
This comment has been minimized.
This comment has been minimized.
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.
70be469 to
c665cbc
Compare
Contributor
Author
|
Okay @bjorn3 I updated this so it's waiting on review again. |
Collaborator
|
The job Click to see the possible cause of the failure (guessed by this bot)For more information how to resolve CI failures of this job, visit this link. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.I also fixed the
terminatehandler to not be invoked when a foreign exception is raised, mimicking the behavior from msvc. On wasm, in order to avoid generating acatch_allwe need to callllvm.wasm.get.exceptionandllvm.wasm.get.ehselector.