From 156f89f0e7d18e47942e0dd315561acafbba17b5 Mon Sep 17 00:00:00 2001 From: Joshua ben Jore Date: Wed, 17 Jan 2007 09:49:22 -0800 Subject: [PATCH] Re: [perl #41283] B::walkoptree_slow fails for 'our @foo = split( m/ /, "hello" )' From: "Joshua ben Jore" Message-ID: p4raw-id: //depot/perl@29972 --- ext/B/B.pm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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; -- 1.8.3.1