From be2dba8416d98a3b23f2cd39747fff4275177fc8 Mon Sep 17 00:00:00 2001 From: Andrew Kesterson Date: Thu, 21 May 2026 21:44:52 -0400 Subject: [PATCH] Fix a bug in the new VALID() method, false is not true --- include/akerror.tmpl.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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?)"); \ }