From: Father Chrysostomos Date: Mon, 19 Dec 2011 04:48:40 +0000 (-0800) Subject: Fix deparsing of require "a".$1 X-Git-Tag: accepted/trunk/20130322.191538~1651 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c75b48285099abf58b5c90c62f8088a00a8c2b66;p=platform%2Fupstream%2Fperl.git Fix deparsing of require "a".$1 Commit 30fcd6c41 tried to deparse ‘no 6’ correctly by checking whether the kidop of a require has the OPpCONST_NOVER flag set, but it did not check the op type, so it ended up with a false positive for any binop (OPpCONST_NOVER being 2). --- diff --git a/dist/B-Deparse/Deparse.pm b/dist/B-Deparse/Deparse.pm index 977ce4d..3ca229d 100644 --- a/dist/B-Deparse/Deparse.pm +++ b/dist/B-Deparse/Deparse.pm @@ -1889,7 +1889,10 @@ sub pp_require { } else { $self->unop( $op, $cx, - $op->first->private & OPpCONST_NOVER ? "no" : $opname, + $op->first->name eq 'const' + && $op->first->private & OPpCONST_NOVER + ? "no" + : $opname, 1, # llafr does not apply ); } diff --git a/dist/B-Deparse/t/deparse.t b/dist/B-Deparse/t/deparse.t index 2c3efd5..22f2cb5 100644 --- a/dist/B-Deparse/t/deparse.t +++ b/dist/B-Deparse/t/deparse.t @@ -893,3 +893,6 @@ pipe local *FH, local *FH; #### # [perl #74740] -(f()) vs -f() $_ = -(f()); +#### +# require +require 'a' . $1;