Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent aborting guard from aborting the process in a forced unwind #104070

Merged
merged 7 commits into from
May 8, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add todo for filter landing pad
  • Loading branch information
nbdd0121 committed May 7, 2023
commit 91afde57a28b1619f140fbe8463d150ce7c8adca
1 change: 1 addition & 0 deletions compiler/rustc_codegen_gcc/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1228,6 +1228,7 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
}

fn filter_landing_pad(&mut self, pers_fn: RValue<'gcc>) -> (RValue<'gcc>, RValue<'gcc>) {
// TODO(antoyo): generate the correct landing pad
self.cleanup_landing_pad(pers_fn)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems incorrect?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The proper way to encode this in GCC would be <<<eh_filter (NULL)>>> (or even better, <<<eh_must_not_throw (terminate)>>>, which is something we hoped for for LLVM!). But I don't think there is support in libgccjit yet, @antoyo to confirm?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I'll take care of this. I'm not done with supporting unwinding yet.

But, please add a // TODO(antoyo): generate the correct landing pad.

For my personal information, what are <<<eh_filter (NULL)>>> and <<<eh_must_not_throw (terminate)>>>? I've never seen this syntax. Are they C attributes?

I don't remember exactly what filter is doing, but the proper implementation of this method might be very similar as cleanup_landing_pad, but without adding to self.cleanup_blocks.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are part of generic/gimple: https://godbolt.org/z/5adjbahnd

}

Expand Down