From: Rafael Garcia-Suarez Date: Wed, 10 Apr 2002 20:07:42 +0000 (+0000) Subject: Fix a bug in B::walkoptree_slow (wasn't handling OP_SUBSTCONT X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0091380ba82527bc2944c1326dd5adebeba74266;p=p5sagit%2Fp5-mst-13.2.git Fix a bug in B::walkoptree_slow (wasn't handling OP_SUBSTCONT correctly). As a side-effect, fix a bug in B::Lint. The corresponding bug in B::walkoptree still to be fixed. p4raw-id: //depot/perl@15850 --- diff --git a/ext/B/B.pm b/ext/B/B.pm index 305c5b8..feca2e5 100644 --- a/ext/B/B.pm +++ b/ext/B/B.pm @@ -126,6 +126,11 @@ sub walkoptree_slow { } shift @parents; } + if (class($op) eq 'PMOP' && $op->pmreplroot && ${$op->pmreplroot}) { + unshift(@parents, $op); + walkoptree_slow($op->pmreplroot, $method, $level + 1); + shift @parents; + } } sub compile_stats { diff --git a/ext/B/B/Lint.pm b/ext/B/B/Lint.pm index 0115d2f..cb15b79 100644 --- a/ext/B/B/Lint.pm +++ b/ext/B/B/Lint.pm @@ -290,11 +290,11 @@ sub do_lint { # Now do subs in main no strict qw(vars refs); - my $sym; local(*glob); - while (($sym, *glob) = each %{"main::"}) { - #warn "Trying $sym\n";#debug - svref_2object(\*glob)->EGV->lintcv unless $sym =~ /::$/; + for my $sym (keys %main::) { + next if $sym =~ /::$/; + *glob = $main::{$sym}; + svref_2object(\*glob)->EGV->lintcv; } # Now do subs in non-main packages given by -u options diff --git a/ext/B/t/lint.t b/ext/B/t/lint.t index 142e470..6f21eaf 100644 --- a/ext/B/t/lint.t +++ b/ext/B/t/lint.t @@ -79,11 +79,8 @@ RESULT Use of regexp variable $& at -e line 1 RESULT - { - local $TODO = 'bug'; - runlint 'regexp-variables', 's/./$&/', <<'RESULT'; + runlint 'regexp-variables', 's/./$&/', <<'RESULT'; Use of regexp variable $& at -e line 1 RESULT - } }