summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorNick Ing-Simmons <nik@tiuk.ti.com>2000-12-11 23:59:59 +0000
committerNick Ing-Simmons <nik@tiuk.ti.com>2000-12-11 23:59:59 +0000
commit360eb788a3c30916019278c140e3ebfb207f591f (patch)
tree7061130299382f3ec1e62223fe788bf58a355181 /ext
parent72e44f29ea535faa4a4afab64f5101668334125d (diff)
downloadperl-360eb788a3c30916019278c140e3ebfb207f591f.tar.gz
Integrate mainline
p4raw-id: //depot/perlio@8088
Diffstat (limited to 'ext')
-rw-r--r--ext/B/B.pm12
-rw-r--r--ext/B/B/Deparse.pm6
2 files changed, 12 insertions, 6 deletions
diff --git a/ext/B/B.pm b/ext/B/B.pm
index a9ea704d78..982395bb72 100644
--- a/ext/B/B.pm
+++ b/ext/B/B.pm
@@ -9,12 +9,16 @@ package B;
use XSLoader ();
require Exporter;
@ISA = qw(Exporter);
+
+# walkoptree comes from B.pm (you are there), walkoptree comes from B.xs
@EXPORT_OK = qw(minus_c ppname save_BEGINs
class peekop cast_I32 cstring cchar hash threadsv_names
- main_root main_start main_cv svref_2object opnumber amagic_generation
+ main_root main_start main_cv svref_2object opnumber
+ amagic_generation
walkoptree_slow walkoptree walkoptree_exec walksymtable
parents comppadlist sv_undef compile_stats timing_info
begin_av init_av end_av);
+
sub OPf_KIDS ();
use strict;
@B::SV::ISA = 'B::OBJECT';
@@ -80,7 +84,7 @@ sub peekop {
return sprintf("%s (0x%x) %s", class($op), $$op, $op->name);
}
-sub walkoptree {
+sub walkoptree_slow {
my($op, $method, $level) = @_;
$op_count++; # just for statistics
$level ||= 0;
@@ -90,14 +94,12 @@ sub walkoptree {
my $kid;
unshift(@parents, $op);
for ($kid = $op->first; $$kid; $kid = $kid->sibling) {
- walkoptree($kid, $method, $level + 1);
+ walkoptree_slow($kid, $method, $level + 1);
}
shift @parents;
}
}
-*walkoptree_slow = \&walkoptree; # Who is using this?
-
sub compile_stats {
return "Total number of OPs processed: $op_count\n";
}
diff --git a/ext/B/B/Deparse.pm b/ext/B/B/Deparse.pm
index 7d1675290b..37c08554c9 100644
--- a/ext/B/B/Deparse.pm
+++ b/ext/B/B/Deparse.pm
@@ -1792,7 +1792,7 @@ sub pp_leaveloop {
my $state = $kid->first;
my $cuddle = $self->{'cuddle'};
my($expr, @exprs);
- for (; $$state != $$cont; $state = $state->sibling) {
+ for (; $$state != $$cont and can $state "sibling"; $state = $state->sibling) {
$expr = "";
if (is_state $state) {
$expr = $self->deparse($state, 0);
@@ -1803,8 +1803,12 @@ sub pp_leaveloop {
push @exprs, $expr if $expr;
}
$kid = join(";\n", @exprs);
+ if (class($cont) eq "LISTOP") {
$cont = $cuddle . "continue {\n\t" .
$self->deparse($cont, 0) . "\n\b}\cK";
+ } else {
+ $cont = "\cK";
+ }
} else {
$cont = "\cK";
$kid = $self->deparse($kid, 0);