Change 30034 by [EMAIL PROTECTED] on 2007/01/27 17:03:59
newPADOP()'s sv parameter is never NULL, so mark it as so.
(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...)
Affected files ...
... //depot/perl/embed.fnc#458 edit
... //depot/perl/op.c#882 edit
... //depot/perl/proto.h#796 edit
Differences ...
==== //depot/perl/embed.fnc#458 (text) ====
Index: perl/embed.fnc
--- perl/embed.fnc#457~30032~ 2007-01-27 07:36:49.000000000 -0800
+++ perl/embed.fnc 2007-01-27 09:03:59.000000000 -0800
@@ -567,7 +567,7 @@
Apa |IO* |newIO
Apa |OP* |newLISTOP |I32 type|I32 flags|NULLOK OP* first|NULLOK OP*
last
#ifdef USE_ITHREADS
-Apa |OP* |newPADOP |I32 type|I32 flags|NULLOK SV* sv
+Apa |OP* |newPADOP |I32 type|I32 flags|NN SV* sv
#endif
Apa |OP* |newPMOP |I32 type|I32 flags
Apa |OP* |newPVOP |I32 type|I32 flags|NULLOK char* pv
==== //depot/perl/op.c#882 (text) ====
Index: perl/op.c
--- perl/op.c#881~30032~ 2007-01-27 07:36:49.000000000 -0800
+++ perl/op.c 2007-01-27 09:03:59.000000000 -0800
@@ -3433,8 +3433,8 @@
padop->op_padix = pad_alloc(type, SVs_PADTMP);
SvREFCNT_dec(PAD_SVl(padop->op_padix));
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 @@
Perl_newGVOP(pTHX_ I32 type, I32 flags, GV *gv)
{
dVAR;
+ assert(gv);
#ifdef USE_ITHREADS
- if (gv)
- GvIN_PAD_on(gv);
+ GvIN_PAD_on(gv);
return newPADOP(type, flags, SvREFCNT_inc_simple(gv));
#else
return newSVOP(type, flags, SvREFCNT_inc_simple(gv));
==== //depot/perl/proto.h#796 (text+w) ====
Index: perl/proto.h
--- perl/proto.h#795~30032~ 2007-01-27 07:36:49.000000000 -0800
+++ perl/proto.h 2007-01-27 09:03:59.000000000 -0800
@@ -1552,7 +1552,8 @@
#ifdef USE_ITHREADS
PERL_CALLCONV OP* Perl_newPADOP(pTHX_ I32 type, I32 flags, SV* sv)
__attribute__malloc__
- __attribute__warn_unused_result__;
+ __attribute__warn_unused_result__
+ __attribute__nonnull__(pTHX_3);
#endif
PERL_CALLCONV OP* Perl_newPMOP(pTHX_ I32 type, I32 flags)
End of Patch.