From: Father Chrysostomos Date: Wed, 18 May 2011 21:38:48 +0000 (-0700) Subject: [perl #90898] B::Deparse failure on glob() X-Git-Tag: accepted/trunk/20130322.191538~4229 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cb8578ffae704f3e20f9f83baa8b9542a9b6add6;p=platform%2Fupstream%2Fperl.git [perl #90898] B::Deparse failure on glob() Change d1bea3d changed the way that glob() is converted into a CORE::GLOBAL::glob call, by preserving the OP_GLOB node, so that it could still do overloading. But B::Deparse was never updated to account for the change to the op tree. --- diff --git a/dist/B-Deparse/Deparse.pm b/dist/B-Deparse/Deparse.pm index 7ea7fc1..3f3c1e8 100644 --- a/dist/B-Deparse/Deparse.pm +++ b/dist/B-Deparse/Deparse.pm @@ -26,7 +26,7 @@ use B qw(class main_root main_start main_cv svref_2object opnumber perlstring ($] < 5.009 ? 'PMf_SKIPWHITE' : qw(RXf_SKIPWHITE)), ($] < 5.011 ? 'CVf_LOCKED' : 'OPpREVERSE_INPLACE'), ($] < 5.013 ? () : 'PMf_NONDESTRUCT'); -$VERSION = "1.03"; +$VERSION = "1.04"; use strict; use vars qw/$AUTOLOAD/; use warnings (); @@ -2404,6 +2404,9 @@ sub pp_syscall { listop(@_, "syscall") } sub pp_glob { my $self = shift; my($op, $cx) = @_; + if ($op->flags & OPf_SPECIAL) { + return $self->deparse($op->first->sibling); + } my $text = $self->dq($op->first->sibling); # skip pushmark if ($text =~ /^\$?(\w|::|\`)+$/ # could look like a readline or $text =~ /[<>]/) { @@ -3393,14 +3396,6 @@ sub pp_entersub { return $prefix . $amper. $kid; } } else { - # glob() invocations can be translated into calls of - # CORE::GLOBAL::glob with a second parameter, a number. - # Reverse this. - if ($kid eq "CORE::GLOBAL::glob") { - $kid = "glob"; - $args =~ s/\s*,[^,]+$//; - } - # It's a syntax error to call CORE::GLOBAL::foo without a prefix, # so it must have been translated from a keyword call. Translate # it back. diff --git a/dist/B-Deparse/t/deparse.t b/dist/B-Deparse/t/deparse.t index 50baa90..c3301a5 100644 --- a/dist/B-Deparse/t/deparse.t +++ b/dist/B-Deparse/t/deparse.t @@ -694,3 +694,6 @@ tr/a/b/r; #### # y/uni/code/ tr/\x{345}/\x{370}/; +#### +# [perl #90898] +glob('a,');