From: Joshua ben Jore Date: Wed, 17 Jan 2007 17:49:22 +0000 (-0800) Subject: Re: [perl #41283] B::walkoptree_slow fails for 'our @foo = split( m/ /, "hello" )' X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=156f89f0e7d18e47942e0dd315561acafbba17b5;p=p5sagit%2Fp5-mst-13.2.git Re: [perl #41283] B::walkoptree_slow fails for 'our @foo = split( m/ /, "hello" )' From: "Joshua ben Jore" Message-ID: p4raw-id: //depot/perl@29972 --- diff --git a/ext/B/B.pm b/ext/B/B.pm index 332018f..2e5409c 100644 --- a/ext/B/B.pm +++ b/ext/B/B.pm @@ -7,7 +7,7 @@ # package B; -our $VERSION = '1.14'; +our $VERSION = '1.15'; use XSLoader (); require Exporter; @@ -119,7 +119,7 @@ sub walkoptree_slow { $op_count++; # just for statistics $level ||= 0; warn(sprintf("walkoptree: %d. %s\n", $level, peekop($op))) if $debug; - $op->$method($level); + $op->$method($level) if $op->can($method); if ($$op && ($op->flags & OPf_KIDS)) { my $kid; unshift(@parents, $op); @@ -128,7 +128,11 @@ sub walkoptree_slow { } shift @parents; } - if (class($op) eq 'PMOP' && ref($op->pmreplroot) && ${$op->pmreplroot}) { + if (class($op) eq 'PMOP' + && ref($op->pmreplroot) + && ${$op->pmreplroot} + && $op->pmreplroot->isa( 'B::OP' )) + { unshift(@parents, $op); walkoptree_slow($op->pmreplroot, $method, $level + 1); shift @parents;