From c75b48285099abf58b5c90c62f8088a00a8c2b66 Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Sun, 18 Dec 2011 20:48:40 -0800 Subject: [PATCH] Fix deparsing of require "a".$1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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). --- dist/B-Deparse/Deparse.pm | 5 ++++- dist/B-Deparse/t/deparse.t | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) 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; -- 2.7.4