mirror of
https://github.com/ipxe/ipxe.git
synced 2026-05-05 12:26:37 +02:00
[libc] Display assertion failure message before incrementing counter
During early initialisation on some platforms, the .data and .bss sections may not yet be writable. Display the assertion message before attempting to increment the assertion failure counter, since writing to the assertion counter may trigger a CPU exception that ends up resetting the system. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
parent
8fe3c68b31
commit
1d58d928fe
@ -49,9 +49,9 @@ assert_printf ( const char *fmt, ... ) asm ( "printf" );
|
||||
#define assert( condition ) \
|
||||
do { \
|
||||
if ( ASSERTING && ! (condition) ) { \
|
||||
assertion_failures++; \
|
||||
assert_printf ( "assert(%s) failed at %s line %d\n", \
|
||||
#condition, __FILE__, __LINE__ ); \
|
||||
assertion_failures++; \
|
||||
} \
|
||||
} while ( 0 )
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user