diff --git a/include/akerror.tmpl.h b/include/akerror.tmpl.h index 6d9da68..d336f0d 100644 --- a/include/akerror.tmpl.h +++ b/include/akerror.tmpl.h @@ -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?)"); \ }