From: Vishal Bhatia Date: Wed, 28 Oct 1998 23:45:32 +0000 (-0800) Subject: hand-apply whitespace-mutiliated patch X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7de5877eb7f5b2d92e4a36dccb57f8b05ae591d1;p=p5sagit%2Fp5-mst-13.2.git hand-apply whitespace-mutiliated patch Message-ID: <19981029074534.2334.qmail@hotmail.com> Subject: [PATCH 5.005_52]Compiling modules,more bugfixes for B p4raw-id: //depot/perl@2146 --- diff --git a/ext/B/B/C.pm b/ext/B/B/C.pm index 1e999e7..5b00e2f 100644 --- a/ext/B/B/C.pm +++ b/ext/B/B/C.pm @@ -1062,6 +1062,12 @@ sub B::GV::savecv { warn sprintf("saving extra CV &%s::%s (0x%x) from GV 0x%x\n", $gv->STASH->NAME, $name, $$cv, $$gv); } + my $package=$gv->STASH->NAME; + if ( ! grep(/^$package$/,@unused_sub_packages)){ + warn sprintf("omitting cv in superclass %s", $gv->STASH->NAME) + if $debug_cv; + return ; + } $gv->save; } } @@ -1069,12 +1075,17 @@ sub B::GV::savecv { sub save_unused_subs { my %search_pack; map { $search_pack{$_} = 1 } @_; + @unused_sub_packages=@_; no strict qw(vars refs); walksymtable(\%{"main::"}, "savecv", sub { my $package = shift; $package =~ s/::$//; #warn "Considering $package\n";#debug return 1 if exists $search_pack{$package}; + #sub try for a partial match + if (grep(/^$package\:\:/,@unused_sub_packages)){ + return 1; + } #warn " (nothing explicit)\n";#debug # Omit the packages which we use (and which cause grief # because of fancy "goto &$AUTOLOAD" stuff). @@ -1088,6 +1099,7 @@ sub save_unused_subs { foreach $m (qw(new DESTROY TIESCALAR TIEARRAY TIEHASH)) { if (defined(&{$package."::$m"})) { warn "$package has method $m: -u$package assumed\n";#debug + push @unused_sub_package, $package; return 1; } } diff --git a/ext/B/B/CC.pm b/ext/B/B/CC.pm index c58a832..d200d70 100644 --- a/ext/B/B/CC.pm +++ b/ext/B/B/CC.pm @@ -1063,7 +1063,7 @@ sub pp_return { write_back_lexicals(REGISTER|TEMPORARY); write_back_stack(); doop($op); - runtime("PUTBACK;", "return 0;"); + runtime("PUTBACK;", "return (PL_op)?PL_op->op_next:0;"); $know_op = 0; return $op->next; } @@ -1356,7 +1356,7 @@ sub cc { $need_freetmps = 0; } if (!$$op) { - runtime("PUTBACK;", "return 0;"); + runtime("PUTBACK;","return (PL_op)?PL_op->op_next:0;"); } elsif ($done{$$op}) { runtime(sprintf("goto %s;", label($op))); }