mi: More meaningful assert crashes
When we fail an assert in miregion.c (which happens every now and then, though I haven't yet checked up why), at least generate a segfault, so we'll get a backtrace.
This commit is contained in:
parent
57d48d94b8
commit
88bec0915e
|
@ -89,9 +89,14 @@ Equipment Corporation.
|
||||||
|
|
||||||
#undef assert
|
#undef assert
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
#define assert(expr) {if (!(expr)) \
|
#define assert(expr) { \
|
||||||
FatalError("Assertion failed file %s, line %d: expr\n", \
|
CARD32 *foo = NULL; \
|
||||||
__FILE__, __LINE__); }
|
if (!(expr)) { \
|
||||||
|
ErrorF("Assertion failed file %s, line %d: %s\n", \
|
||||||
|
__FILE__, __LINE__, #expr); \
|
||||||
|
*foo = 0xdeadbeef; /* to get a backtrace */ \
|
||||||
|
} \
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
#define assert(expr)
|
#define assert(expr)
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue
Block a user