From: Rafael Garcia-Suarez Date: Sun, 6 Jan 2008 15:37:13 +0000 (+0000) Subject: Fix bug #49298: B::Deparse fails to deparse a reference to an anonymous hash X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=35925e80e0fed63e4413b5afa3d4ad736791b504;p=p5sagit%2Fp5-mst-13.2.git Fix bug #49298: B::Deparse fails to deparse a reference to an anonymous hash p4raw-id: //depot/perl@32869 --- diff --git a/ext/B/B/Deparse.pm b/ext/B/B/Deparse.pm index 9c4f4c3..8230755 100644 --- a/ext/B/B/Deparse.pm +++ b/ext/B/B/Deparse.pm @@ -21,7 +21,7 @@ use B qw(class main_root main_start main_cv svref_2object opnumber perlstring PMf_KEEP PMf_GLOBAL PMf_CONTINUE PMf_EVAL PMf_ONCE PMf_MULTILINE PMf_SINGLELINE PMf_FOLD PMf_EXTENDED), ($] < 5.009 ? 'PMf_SKIPWHITE' : 'RXf_SKIPWHITE'); -$VERSION = 0.84; +$VERSION = 0.85; use strict; use vars qw/$AUTOLOAD/; use warnings (); @@ -1826,9 +1826,7 @@ sub pp_refgen { my $kid = $op->first; if ($kid->name eq "null") { $kid = $kid->first; - if ($kid->name eq "anonlist" || $kid->name eq "anonhash") { - return $self->anon_hash_or_list($op, $cx); - } elsif (!null($kid->sibling) and + if (!null($kid->sibling) and $kid->sibling->name eq "anoncode") { return $self->e_anoncode({ code => $self->padval($kid->sibling->targ) }); } elsif ($kid->name eq "pushmark") { diff --git a/ext/B/t/deparse.t b/ext/B/t/deparse.t index 7aeb159..a85e5ce 100644 --- a/ext/B/t/deparse.t +++ b/ext/B/t/deparse.t @@ -27,7 +27,7 @@ BEGIN { require feature; feature->import(':5.10'); } -use Test::More tests => 57; +use Test::More tests => 58; use B::Deparse; my $deparse = B::Deparse->new(); @@ -395,3 +395,8 @@ each @$a; # 50 keys @array; values @array keys @$a if keys @ARGV; values @ARGV if values @$a; +#### +my $a = {}; +my $b = \{}; +my $c = []; +my $d = \[];