This is a live mirror of the Perl 5 development currently hosted at
newPADOP()'s sv parameter is never NULL, so mark it as so.
authorNicholas Clark <>
Sat, 27 Jan 2007 17:03:59 +0000 (17:03 +0000)
committerNicholas Clark <>
Sat, 27 Jan 2007 17:03:59 +0000 (17:03 +0000)
(Well, in theory it could be NULL if someone is creating ops during
symbol table destruction, but snowballs in hell, etc.
This is usually the point where Jarkko observes that the aliens are
looking for a free slot in their diaries...)

p4raw-id: //depot/perl@30034


index a51b6b0..5c33ad9 100644 (file)
--- a/embed.fnc
+++ b/embed.fnc
@@ -567,7 +567,7 @@ ApaR        |HV*    |newHVhv        |NULLOK HV* hv
 Apa    |IO*    |newIO
 Apa    |OP*    |newLISTOP      |I32 type|I32 flags|NULLOK OP* first|NULLOK OP* last
-Apa    |OP*    |newPADOP       |I32 type|I32 flags|NULLOK SV* sv
+Apa    |OP*    |newPADOP       |I32 type|I32 flags|NN SV* sv
 Apa    |OP*    |newPMOP        |I32 type|I32 flags
 Apa    |OP*    |newPVOP        |I32 type|I32 flags|NULLOK char* pv
diff --git a/op.c b/op.c
index 8c5891f..8e3e5f8 100644 (file)
--- a/op.c
+++ b/op.c
@@ -3433,8 +3433,8 @@ Perl_newPADOP(pTHX_ I32 type, I32 flags, SV *sv)
     padop->op_padix = pad_alloc(type, SVs_PADTMP);
     PAD_SETSV(padop->op_padix, sv);
-    if (sv)
-       SvPADTMP_on(sv);
+    assert(sv);
+    SvPADTMP_on(sv);
     padop->op_next = (OP*)padop;
     padop->op_flags = (U8)flags;
     if (PL_opargs[type] & OA_RETSCALAR)
@@ -3449,9 +3449,9 @@ OP *
 Perl_newGVOP(pTHX_ I32 type, I32 flags, GV *gv)
+    assert(gv);
-    if (gv)
-       GvIN_PAD_on(gv);
+    GvIN_PAD_on(gv);
     return newPADOP(type, flags, SvREFCNT_inc_simple(gv));
     return newSVOP(type, flags, SvREFCNT_inc_simple(gv));
diff --git a/proto.h b/proto.h
index a76e001..f9bcc51 100644 (file)
--- a/proto.h
+++ b/proto.h
@@ -1552,7 +1552,8 @@ PERL_CALLCONV OP* Perl_newLISTOP(pTHX_ I32 type, I32 flags, OP* first, OP* last)
 PERL_CALLCONV OP*      Perl_newPADOP(pTHX_ I32 type, I32 flags, SV* sv)
-                       __attribute__warn_unused_result__;
+                       __attribute__warn_unused_result__
+                       __attribute__nonnull__(pTHX_3);
 PERL_CALLCONV OP*      Perl_newPMOP(pTHX_ I32 type, I32 flags)