mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-08 17:42:12 +03:00
(checkhdr): Disable mcheck before reporting an error. Don't run any tests if mcheck is disabled.
This commit is contained in:
@@ -55,6 +55,8 @@ struct hdr
|
|||||||
It is only constructed if the pedantic testing is requested. */
|
It is only constructed if the pedantic testing is requested. */
|
||||||
static struct hdr *root;
|
static struct hdr *root;
|
||||||
|
|
||||||
|
static int mcheck_used;
|
||||||
|
|
||||||
/* Nonzero if pedentic checking of all blocks is requested. */
|
/* Nonzero if pedentic checking of all blocks is requested. */
|
||||||
static int pedantic;
|
static int pedantic;
|
||||||
|
|
||||||
@@ -81,6 +83,12 @@ checkhdr (hdr)
|
|||||||
const struct hdr *hdr;
|
const struct hdr *hdr;
|
||||||
{
|
{
|
||||||
enum mcheck_status status;
|
enum mcheck_status status;
|
||||||
|
|
||||||
|
if (!mcheck_used)
|
||||||
|
/* Maybe the mcheck used is disabled? This happens when we find
|
||||||
|
an error and report it. */
|
||||||
|
return MCHECK_OK;
|
||||||
|
|
||||||
switch (hdr->magic ^ ((uintptr_t) hdr->prev + (uintptr_t) hdr->next))
|
switch (hdr->magic ^ ((uintptr_t) hdr->prev + (uintptr_t) hdr->next))
|
||||||
{
|
{
|
||||||
default:
|
default:
|
||||||
@@ -97,7 +105,11 @@ checkhdr (hdr)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (status != MCHECK_OK)
|
if (status != MCHECK_OK)
|
||||||
(*abortfunc) (status);
|
{
|
||||||
|
mcheck_used = 0;
|
||||||
|
(*abortfunc) (status);
|
||||||
|
mcheck_used = 1;
|
||||||
|
}
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -302,8 +314,6 @@ mabort (status)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static int mcheck_used;
|
|
||||||
|
|
||||||
int
|
int
|
||||||
mcheck (func)
|
mcheck (func)
|
||||||
void (*func) __P ((enum mcheck_status));
|
void (*func) __P ((enum mcheck_status));
|
||||||
|
Reference in New Issue
Block a user