allow "my ()" [perl #113554]
authorJesse Luehrs <doy@tozt.net>
Mon, 25 Jun 2012 05:39:57 +0000 (00:39 -0500)
committerJesse Luehrs <doy@tozt.net>
Mon, 25 Jun 2012 05:39:57 +0000 (00:39 -0500)
it looks like this was an unrelated bugfix during development of mad,
but which was merged into core with #ifdef PERL_MAD just because it was
a change from the existing perl code... i don't see any reason why this
should have been ifdef'd out to begin with

op.c
t/op/my.t

diff --git a/op.c b/op.c
index 5756eeb..a93a458 100644 (file)
--- a/op.c
+++ b/op.c
@@ -2472,11 +2472,7 @@ S_my_kid(pTHX_ OP *o, OP *attrs, OP **imopsp)
        for (kid = cLISTOPo->op_first; kid; kid = kid->op_sibling)
            my_kid(kid, attrs, imopsp);
        return o;
-    } else if (type == OP_UNDEF
-#ifdef PERL_MAD
-              || type == OP_STUB
-#endif
-              ) {
+    } else if (type == OP_UNDEF || type == OP_STUB) {
        return o;
     } else if (type == OP_RV2SV ||     /* "our" declaration */
               type == OP_RV2AV ||
index 6a477db..003f456 100644 (file)
--- a/t/op/my.t
+++ b/t/op/my.t
@@ -1,6 +1,6 @@
 #!./perl
 
-print "1..36\n";
+print "1..37\n";
 
 sub foo {
     my($a, $b) = @_;
@@ -130,3 +130,8 @@ print "ok 34\n";
     $test = 42;
     goto loop if ++$count < 37;
 }
+
+# [perl #113554]
+eval "my ()";
+print "not " if $@;
+print "ok 37\n";