Hi,
my tests run, as I already wrote. The perl testbench showed indeed an error in
ext/B/t/deparse.
I corrected this by using a queue of objects, instead of a queue of references
to objects. Now the testbench and my own tests run clean:
ext/B/t/deparse...........................ok
I already presented the benchmark results. This method is now the second
(queue of object), which is still faster and without warnings on Deep
Recursion compared to the old method.
I appended the corrected patch. Please consider sending it upstream.
Best regards,
Toby
--- Deparse.pm.orig 2005-09-26 16:50:49.000000000 +0200
+++ Deparse.pm.new 2006-04-21 22:56:36.000000000 +0200
@@ -1305,21 +1305,26 @@
carp("Undefined op in find_scope") if !defined $op;
return ($scope_st, $scope_en) unless $op->flags & OPf_KIDS;
- for (my $o=$op->first; $$o; $o=$o->sibling) {
- if ($o->name =~ /^pad.v$/ && $o->private & OPpLVAL_INTRO) {
- my $s = int($self->padname_sv($o->targ)->NVX);
- my $e = $self->padname_sv($o->targ)->IVX;
- $scope_st = $s if !defined($scope_st) || $s < $scope_st;
- $scope_en = $e if !defined($scope_en) || $e > $scope_en;
- }
- elsif (is_state($o)) {
- my $c = $o->cop_seq;
- $scope_st = $c if !defined($scope_st) || $c < $scope_st;
- $scope_en = $c if !defined($scope_en) || $c > $scope_en;
- }
- elsif ($o->flags & OPf_KIDS) {
- ($scope_st, $scope_en) =
- $self->find_scope($o, $scope_st, $scope_en)
+ my @queue = ($op);
+ while(@queue) {
+ $op = shift(@queue);
+ for (my $o=$op->first; $$o; $o=$o->sibling) {
+ if ($o->name =~ /^pad.v$/ && $o->private & OPpLVAL_INTRO) {
+ my $s = int($self->padname_sv($o->targ)->NVX);
+ my $e = $self->padname_sv($o->targ)->IVX;
+ $scope_st = $s if !defined($scope_st) || $s < $scope_st;
+ $scope_en = $e if !defined($scope_en) || $e > $scope_en;
+ return ($scope_st, $scope_en);
+ }
+ elsif (is_state($o)) {
+ my $c = $o->cop_seq;
+ $scope_st = $c if !defined($scope_st) || $c < $scope_st;
+ $scope_en = $c if !defined($scope_en) || $c > $scope_en;
+ return ($scope_st, $scope_en);
+ }
+ elsif ($o->flags & OPf_KIDS) {
+ push(@queue, $o);
+ }
}
}