Skip to content

Commit 37f7d32

Browse files
committed
Prevent aborting guard from aborting the process in a forced unwind
1 parent 6223753 commit 37f7d32

File tree

1 file changed

+3
-0
lines changed
  • library/std/src/personality

1 file changed

+3
-0
lines changed

library/std/src/personality/gcc.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ cfg_if::cfg_if! {
147147
} else {
148148
match eh_action {
149149
EHAction::None => return continue_unwind(exception_object, context),
150+
EHAction::Filter(_) if state & uw::_US_FORCE_UNWIND as c_int != 0 => return continue_unwind(exception_object, context),
150151
EHAction::Cleanup(lpad) | EHAction::Catch(lpad) | EHAction::Filter(lpad) => {
151152
uw::_Unwind_SetGR(
152153
context,
@@ -207,6 +208,8 @@ cfg_if::cfg_if! {
207208
} else {
208209
match eh_action {
209210
EHAction::None => uw::_URC_CONTINUE_UNWIND,
211+
// Forced unwinding hits a terminate action.
212+
EHAction::Filter(_) if actions as i32 & uw::_UA_FORCE_UNWIND as i32 != 0 => uw::_URC_CONTINUE_UNWIND,
210213
EHAction::Cleanup(lpad) | EHAction::Catch(lpad) | EHAction::Filter(lpad) => {
211214
uw::_Unwind_SetGR(
212215
context,

0 commit comments

Comments
 (0)