From: "Joshua ben Jore" <twists@gmail.com>
Message-ID: <
dc5c751d0701171749x3f2dfd00tc523d33bc234c530@mail.gmail.com>
p4raw-id: //depot/perl@29972
#
package B;
-our $VERSION = '1.14';
+our $VERSION = '1.15';
use XSLoader ();
require Exporter;
$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);
}
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;