Integrate with Sarathy. perldiag.pod required manual editing.
[p5sagit/p5-mst-13.2.git] / ext / B / B / Xref.pm
index 0102856..16f25ff 100644 (file)
@@ -85,11 +85,9 @@ Malcolm Beattie, mbeattie@sable.ox.ac.uk.
 =cut
 
 use strict;
-use B qw(peekop class comppadlist main_start svref_2object walksymtable);
-
-# Constants (should probably be elsewhere)
-sub OPpLVAL_INTRO () { 128 }
-sub SVf_POK () { 0x40000 }
+use B qw(peekop class comppadlist main_start svref_2object walksymtable
+         OPpLVAL_INTRO SVf_POK
+        );
 
 sub UNKNOWN { ["?", "?", "?"] }
 
@@ -143,7 +141,7 @@ sub load_pad {
     for ($ix = 1; $ix < @namelist; $ix++) {
        my $namesv = $namelist[$ix];
        next if class($namesv) eq "SPECIAL";
-       my ($type, $name) = $namesv->PV =~ /^(.)(.*)$/;
+       my ($type, $name) = $namesv->PV =~ /^(.)([^\0]*)(\0.*)?$/;
        $pad[$ix] = ["(lexical)", $type, $name];
     }
 }
@@ -156,7 +154,7 @@ sub xref {
        warn sprintf("top = [%s, %s, %s]\n", @$top) if $debug_top;
        warn peekop($op), "\n" if $debug_op;
        my $ppname = $op->ppaddr;
-       if ($ppname =~ /^pp_(or|and|mapwhile|grepwhile)$/) {
+       if ($ppname =~ /^pp_(or|and|mapwhile|grepwhile|range|cond_expr)$/) {
            xref($op->other);
        } elsif ($ppname eq "pp_match" || $ppname eq "pp_subst") {
            xref($op->pmreplstart);
@@ -164,11 +162,6 @@ sub xref {
            xref($op->other->pmreplstart);
            $op = $op->other;
            redo;
-       } elsif ($ppname eq "pp_cond_expr") {
-           # pp_cond_expr never returns op_next
-           xref($op->true);
-           $op = $op->false;
-           redo;
        } elsif ($ppname eq "pp_enterloop") {
            xref($op->redoop);
            xref($op->nextop);