summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Houston <robin@cpan.org>2001-04-02 23:54:10 +0100
committerJarkko Hietaniemi <jhi@iki.fi>2001-04-02 22:35:31 +0000
commit0b40bd6de87cfda9faaca1d3ce7584b852e28687 (patch)
treebe632fe442b3962df00d6928d4c0b069c782d1fb
parentb2a3cfdd2ae28c5788743d392c2d839a919b1e53 (diff)
downloadperl-0b40bd6de87cfda9faaca1d3ce7584b852e28687.tar.gz
padname values may have bogus SvCUR
Message-ID: <20010402225410.A8273@puffinry.freeserve.co.uk> p4raw-id: //depot/perl@9522
-rw-r--r--ext/B/B.pm2
-rw-r--r--ext/B/B.xs4
-rw-r--r--ext/B/B/Concise.pm2
-rw-r--r--ext/B/B/Showlex.pm23
4 files changed, 27 insertions, 4 deletions
diff --git a/ext/B/B.pm b/ext/B/B.pm
index 2ab189813e..41ba5d6597 100644
--- a/ext/B/B.pm
+++ b/ext/B/B.pm
@@ -365,6 +365,8 @@ C<REFCNT> (corresponding to the C function C<SvREFCNT>).
=item PV
+=item PVX
+
=back
=head2 B::PVMG METHODS
diff --git a/ext/B/B.xs b/ext/B/B.xs
index fc97c4383a..51ce983422 100644
--- a/ext/B/B.xs
+++ b/ext/B/B.xs
@@ -901,6 +901,10 @@ SvRV(sv)
MODULE = B PACKAGE = B::PV PREFIX = Sv
+char*
+SvPVX(sv)
+ B::PV sv
+
void
SvPV(sv)
B::PV sv
diff --git a/ext/B/B/Concise.pm b/ext/B/B/Concise.pm
index 900a70a8f8..2dd43a932a 100644
--- a/ext/B/B/Concise.pm
+++ b/ext/B/B/Concise.pm
@@ -326,7 +326,7 @@ sub concise_op {
} elsif ($h{targ}) {
my $padname = (($curcv->PADLIST->ARRAY)[0]->ARRAY)[$h{targ}];
if (defined $padname and class($padname) ne "SPECIAL") {
- $h{targarg} = $padname->PV;
+ $h{targarg} = $padname->PVX;
my $intro = $padname->NVX - $cop_seq_base;
my $finish = int($padname->IVX) - $cop_seq_base;
$finish = "end" if $finish == 999999999 - $cop_seq_base;
diff --git a/ext/B/B/Showlex.pm b/ext/B/B/Showlex.pm
index 648f95dcc0..842ca3ee2b 100644
--- a/ext/B/B/Showlex.pm
+++ b/ext/B/B/Showlex.pm
@@ -12,7 +12,24 @@ use B::Terse ();
# to see the names of file scope lexicals used by bar.pl
#
-sub showarray {
+sub shownamearray {
+ my ($name, $av) = @_;
+ my @els = $av->ARRAY;
+ my $count = @els;
+ my $i;
+ print "$name has $count entries\n";
+ for ($i = 0; $i < $count; $i++) {
+ print "$i: ";
+ my $sv = $els[$i];
+ if (class($sv) ne "SPECIAL") {
+ printf "%s (0x%lx) %s\n", class($sv), $$sv, $sv->PVX;
+ } else {
+ $sv->terse;
+ }
+ }
+}
+
+sub showvaluearray {
my ($name, $av) = @_;
my @els = $av->ARRAY;
my $count = @els;
@@ -26,8 +43,8 @@ sub showarray {
sub showlex {
my ($objname, $namesav, $valsav) = @_;
- showarray("Pad of lexical names for $objname", $namesav);
- showarray("Pad of lexical values for $objname", $valsav);
+ shownamearray("Pad of lexical names for $objname", $namesav);
+ showvaluearray("Pad of lexical values for $objname", $valsav);
}
sub showlex_obj {