This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #122728] Make sub(){undef} inlinable
authorFather Chrysostomos <sprout@cpan.org>
Tue, 9 Sep 2014 05:54:10 +0000 (22:54 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Tue, 9 Sep 2014 05:54:29 +0000 (22:54 -0700)
op.c

diff --git a/op.c b/op.c
index 0c6f11e..abe93a7 100644 (file)
--- a/op.c
+++ b/op.c
@@ -7199,6 +7199,10 @@ Perl_op_const_sv(pTHX_ const OP *o, CV *cv)
            return NULL;
        if (type == OP_CONST && cSVOPo->op_sv)
            sv = cSVOPo->op_sv;
+       else if (type == OP_UNDEF && !o->op_private) {
+           sv = newSV(0);
+           SAVEFREESV(sv);
+       }
        else if (cv && type == OP_CONST) {
            sv = PAD_BASE_SV(CvPADLIST(cv), o->op_targ);
            if (!sv)