Perl_croak_nocontext() is called with NULL indirectly from
Steve Peters [Sat, 8 Mar 2008 15:13:26 +0000 (15:13 +0000)]
some XS-based modules.

p4raw-id: //depot/perl@33453

embed.fnc
proto.h
util.c

index 3f361c5..88e3db2 100644 (file)
--- a/embed.fnc
+++ b/embed.fnc
@@ -149,7 +149,7 @@ pM  |PERL_CONTEXT*  |create_eval_scope|U32 flags
 Afprd  |void   |croak          |NULLOK const char* pat|...
 Apr    |void   |vcroak         |NULLOK const char* pat|NULLOK va_list* args
 #if defined(PERL_IMPLICIT_CONTEXT)
-Afnrp  |void   |croak_nocontext|NN const char* pat|...
+Afnrp  |void   |croak_nocontext|NULLOK const char* pat|...
 Afnp   |OP*    |die_nocontext  |NN const char* pat|...
 Afnp   |void   |deb_nocontext  |NN const char* pat|...
 Afnp   |char*  |form_nocontext |NN const char* pat|...
diff --git a/proto.h b/proto.h
index c334b00..ef46817 100644 (file)
--- a/proto.h
+++ b/proto.h
@@ -330,10 +330,7 @@ PERL_CALLCONV void Perl_vcroak(pTHX_ const char* pat, va_list* args)
 #if defined(PERL_IMPLICIT_CONTEXT)
 PERL_CALLCONV void     Perl_croak_nocontext(const char* pat, ...)
                        __attribute__noreturn__
-                       __attribute__format__(__printf__,1,2)
-                       __attribute__nonnull__(1);
-#define PERL_ARGS_ASSERT_CROAK_NOCONTEXT       \
-       assert(pat)
+                       __attribute__format__null_ok__(__printf__,1,2);
 
 PERL_CALLCONV OP*      Perl_die_nocontext(const char* pat, ...)
                        __attribute__format__(__printf__,1,2)
diff --git a/util.c b/util.c
index 82f147e..a6b5c1c 100644 (file)
--- a/util.c
+++ b/util.c
@@ -1432,7 +1432,6 @@ Perl_croak_nocontext(const char *pat, ...)
 {
     dTHX;
     va_list args;
-    PERL_ARGS_ASSERT_CROAK_NOCONTEXT;
     va_start(args, pat);
     vcroak(pat, &args);
     /* NOTREACHED */