From: Father Chrysostomos Date: Mon, 8 Dec 2014 01:24:50 +0000 (-0800) Subject: Fix deparsing of (1,2,3) in void context X-Git-Tag: v5.21.7~265 X-Git-Url: https://perl5.git.perl.org/perl5.git/commitdiff_plain/40ced2f4af33ebeede1480e959ee2d48fdca538c Fix deparsing of (1,2,3) in void context This was broken in v5.21.5-289-g12cea2f. We were trying to check the kid op of an ex-const, but an ex-const has no children. --- diff --git a/lib/B/Deparse.pm b/lib/B/Deparse.pm index 446deb1..a62e101 100644 --- a/lib/B/Deparse.pm +++ b/lib/B/Deparse.pm @@ -3271,7 +3271,8 @@ sub pp_list { } } elsif ($lopname =~ /^(?:gv|rv2)([ash])v$/ && $loppriv & OPpOUR_INTRO - or $lopname eq "null" && $lop->first->name eq "gvsv" + or $lopname eq "null" && class($lop) eq 'UNOP' + && $lop->first->name eq "gvsv" && $lop->first->private & OPpOUR_INTRO) { # our() my $newlocal = "local " x !!($loppriv & OPpLVAL_INTRO) . "our"; ($local = "", last) diff --git a/lib/B/Deparse.t b/lib/B/Deparse.t index 1c3e50b..0bb129e 100644 --- a/lib/B/Deparse.t +++ b/lib/B/Deparse.t @@ -469,6 +469,14 @@ tr/\x{345}/\x{370}/; 2; } #### +# List of constants in void context +# CONTEXT no warnings; +(1,2,3); +0; +>>>> +'???', '???', '???'; +0; +#### # Lexical and simple arithmetic my $test; ++$test and $test /= 2;