diff options
author | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2001-09-28 00:34:32 +0200 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-09-27 22:33:11 +0000 |
commit | d333a2173e786c391c48ee4f5f7df078b91e90b1 (patch) | |
tree | 2c131886a8e830113288104eba71f35ecd467ea7 /ext | |
parent | 6ba6f0ecc2918dcf7dd01bb4421f3880d6d4c6de (diff) | |
download | perl-d333a2173e786c391c48ee4f5f7df078b91e90b1.tar.gz |
Re: [BUG] B::Terse can't handle constant scalar refs
Message-ID: <20010927223432.A1485@rafael>
p4raw-id: //depot/perl@12250
Diffstat (limited to 'ext')
-rw-r--r-- | ext/B/B/Terse.pm | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/ext/B/B/Terse.pm b/ext/B/B/Terse.pm index 52f0549911..4c31a66374 100644 --- a/ext/B/B/Terse.pm +++ b/ext/B/B/Terse.pm @@ -118,6 +118,27 @@ sub B::NV::terse { printf "%s (0x%lx) %s\n", class($sv), $$sv, $sv->NV; } +sub B::RV::terse { + my ($rv, $level) = @_; + print indent($level); + printf "%s (0x%lx) %s\n", class($rv), $$rv, printref($rv); +} + +sub printref { + my $rv = shift; + my $rcl = class($rv->RV); + if ($rcl eq 'PV') { + return "\\" . cstring($rv->RV->$rcl); + } elsif ($rcl eq 'NV') { + return "\\" . $rv->RV->$rcl; + } elsif ($rcl eq 'IV') { + return sprintf "\\%" . ($rv->RV->FLAGS & SVf_IVisUV ? "u" : "d"), + $rv->RV->int_value; + } elsif ($rcl eq 'RV') { + return "\\" . printref($rv->RV); + } +} + sub B::NULL::terse { my ($sv, $level) = @_; print indent($level); |