Prevent aborting guard from aborting the process in a forced unwind

This commit is contained in:
Gary Guo 2022-11-06 21:35:10 +00:00
parent 62237536da
commit 37f7d322b8

View file

@ -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,