diff options
| author | Gary Guo <gary@garyguo.net> | 2022-11-06 21:35:10 +0000 |
|---|---|---|
| committer | Gary Guo <gary@garyguo.net> | 2023-05-07 12:35:54 +0100 |
| commit | 37f7d322b8cd9e9712c3cc9cf3a550371bd164e0 (patch) | |
| tree | 238e6307c63ca8ac191a00758d16f1735164ce12 /library/std | |
| parent | 62237536da0e17fdaa5c03965563a200296c6e12 (diff) | |
| download | rust-37f7d322b8cd9e9712c3cc9cf3a550371bd164e0.tar.gz rust-37f7d322b8cd9e9712c3cc9cf3a550371bd164e0.zip | |
Prevent aborting guard from aborting the process in a forced unwind
Diffstat (limited to 'library/std')
| -rw-r--r-- | library/std/src/personality/gcc.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/library/std/src/personality/gcc.rs b/library/std/src/personality/gcc.rs index 4c29c332b75..82edb11cbd1 100644 --- a/library/std/src/personality/gcc.rs +++ b/library/std/src/personality/gcc.rs @@ -147,6 +147,7 @@ cfg_if::cfg_if! { } else { match eh_action { EHAction::None => return continue_unwind(exception_object, context), + EHAction::Filter(_) if state & uw::_US_FORCE_UNWIND as c_int != 0 => return continue_unwind(exception_object, context), EHAction::Cleanup(lpad) | EHAction::Catch(lpad) | EHAction::Filter(lpad) => { uw::_Unwind_SetGR( context, @@ -207,6 +208,8 @@ cfg_if::cfg_if! { } else { match eh_action { EHAction::None => uw::_URC_CONTINUE_UNWIND, + // Forced unwinding hits a terminate action. + EHAction::Filter(_) if actions as i32 & uw::_UA_FORCE_UNWIND as i32 != 0 => uw::_URC_CONTINUE_UNWIND, EHAction::Cleanup(lpad) | EHAction::Catch(lpad) | EHAction::Filter(lpad) => { uw::_Unwind_SetGR( context, |
