Print a more helpful UNREACHABLE message when NOT_REACHED assertion fails
authorPaul "LeoNerd" Evans <leonerd@leonerd.org.uk>
Wed, 3 Jul 2019 16:19:10 +0000 (17:19 +0100)
committerKarl Williamson <khw@cpan.org>
Wed, 3 Jul 2019 16:42:51 +0000 (10:42 -0600)
perl.h

diff --git a/perl.h b/perl.h
index a82d055..f5f18ff 100644 (file)
--- a/perl.h
+++ b/perl.h
@@ -3509,9 +3509,9 @@ EXTERN_C int perl_tsa_mutex_unlock(perl_mutex* mutex)
 #  define NOT_REACHED
 #elif defined(DEBUGGING) && (__has_builtin(__builtin_unreachable) \
      || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5 || __GNUC__ > 4)) /* 4.5 -> */
-#  define NOT_REACHED STMT_START { ASSUME(0); __builtin_unreachable(); } STMT_END
+#  define NOT_REACHED STMT_START { ASSUME(!"UNREACHABLE"); __builtin_unreachable(); } STMT_END
 #else
-#  define NOT_REACHED ASSUME(0)
+#  define NOT_REACHED ASSUME(!"UNREACHABLE")
 #endif
 
 /* Some unistd.h's give a prototype for pause() even though