[libc++abi] Don't leak in test (#119505)

Trying to re-enable a test on bots

bb695735db/zorg/buildbot/builders/sanitizers/buildbot_functions.sh (L443)

When we reach `terminate()` `exc` pointer is not
on the stack, so lsan correctly reports a leak.
This commit is contained in:
Vitaly Buka
2024-12-10 22:02:32 -08:00
committed by GitHub
parent acaa5fac49
commit a4538cdcee

View File

@@ -44,10 +44,8 @@ struct Stop<R (*)(Args...)> {
};
static void forced_unwind() {
_Unwind_Exception* exc = new _Unwind_Exception;
memset(&exc->exception_class, 0, sizeof(exc->exception_class));
exc->exception_cleanup = 0;
_Unwind_ForcedUnwind(exc, Stop<_Unwind_Stop_Fn>::stop, 0);
static _Unwind_Exception exc = {};
_Unwind_ForcedUnwind(&exc, Stop<_Unwind_Stop_Fn>::stop, 0);
abort();
}