If we aren't manipulating the stack, dont fetch it, check and possibly
extend it. There is a slight chance this EXTEND was covering up missing
EXTENDs somewhere else in Perl core or CPAN C code, if future bisects or
valgrind reports show that this EXTEND by 1 must always be done, this
patch can be reverted. pp_method_named contains a EXTEND/XPUSH* call,
pp_entersub requires 1 arg on stack so, both sides of the
"if (!(flags & G_METHOD_NAMED))" test will in theory make sure there is
1 free slot on the stack on entry to a SUB or XSUB.
See also
http://www.nntp.perl.org/group/perl.perl5.porters/2015/09/msg231329.html
SAVEOP();
PL_op = (OP*)&myop;
- {
+ if (!(flags & G_METHOD_NAMED)) {
dSP;
EXTEND(SP, 1);
- if (!(flags & G_METHOD_NAMED)) {
- PUSHs(sv);
- PUTBACK;
- }
+ PUSHs(sv);
+ PUTBACK;
}
oldmark = TOPMARK;
oldscope = PL_scopestack_ix;