diff --git a/runtime/include/module.h b/runtime/include/module.h index 3a4d6b6..4544de1 100644 --- a/runtime/include/module.h +++ b/runtime/include/module.h @@ -132,7 +132,19 @@ module_initialize_memory(struct module *module) static inline bool module_is_valid(struct module *module) { - return (module && module->dynamic_library_handle && module->main); + if (!module) { + fprintf(stderr, "%lu | module %p | module is unexpectedly NULL\n", pthread_self(), module); + return false; + } else if (!module->dynamic_library_handle) { + fprintf(stderr, "%lu | module %p | module->dynamic_library_handle is unexpectedly NULL\n", + pthread_self(), module); + return false; + } else if (!module->main) { + fprintf(stderr, "%lu | module %p | module->main is unexpectedly NULL\n", pthread_self(), module); + return false; + } + + return true; } /** diff --git a/runtime/include/panic.h b/runtime/include/panic.h index d973c4b..4b28101 100644 --- a/runtime/include/panic.h +++ b/runtime/include/panic.h @@ -1,5 +1,6 @@ #pragma once +#include #include #include #include