Fix a bug in the new VALID() method, false is not true

This commit is contained in:
2026-05-21 21:44:52 -04:00
parent 03e9b8a96d
commit be2dba8416

View File

@@ -74,6 +74,7 @@ char *akerr_name_for_status(int status, char *name);
void akerr_init();
void akerr_default_handler_unhandled_error(akerr_ErrorContext *ptr);
void akerr_default_logger(const char *f, ...);
int akerr_valid_error_address(akerr_ErrorContext *ptr);
/* defined in src/errno.c which is built dynamically at build time from system errno definitions */
void akerr_init_errno(void);
@@ -178,7 +179,7 @@ void akerr_init_errno(void);
#define VALID(__err_context, __stmt) \
__stmt; \
if ( akerr_valid_error_address(__err_context) == 0 ) { \
if ( akerr_valid_error_address(__err_context) == 1 ) { \
FAIL(__err_context, AKERR_BEHAVIOR, "Received (akerr_Error *) from an invalid memory region. (Did the method finish without calling SUCCEED_RETURN?)"); \
}