mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-01 10:06:57 +03:00
Enhance _dl_catch_exception to allow disabling exception handling
In some cases, it is necessary to introduce noexcept regions where raised dynamic loader exceptions (e.g., from lazy binding) are fatal, despite being nested in a code region with an active exception handler. This change enhances _dl_catch_exception with to provide such a capability. The existing function is reused, so that it is not necessary to introduce yet another function with a similar purpose. Change-Id: Iec1bf642ff95a349fdde8040e9baf851ac7b8904
This commit is contained in:
@ -173,6 +173,18 @@ int
|
||||
_dl_catch_exception (struct dl_exception *exception,
|
||||
void (*operate) (void *), void *args)
|
||||
{
|
||||
/* If exception is NULL, temporarily disable exception handling.
|
||||
Exceptions during operate (args) are fatal. */
|
||||
if (exception == NULL)
|
||||
{
|
||||
struct catch *const old = catch_hook;
|
||||
catch_hook = NULL;
|
||||
operate (args);
|
||||
/* If we get here, the operation was successful. */
|
||||
catch_hook = old;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* We need not handle `receiver' since setting a `catch' is handled
|
||||
before it. */
|
||||
|
||||
|
Reference in New Issue
Block a user