if ($class eq "CV") {
$self->todo($referent, 0);
} elsif (
- $class !~ /^(AV|HV|CV|FM|IO)\z/
+ $class !~ /^(AV|HV|CV|FM|IO|SPECIAL)\z/
# A more robust way to write that would be this, but B does
# not provide the SVt_ constants:
# ($referent->FLAGS & B::SVTYPEMASK) < B::SVt_PVAV
return $str;
} elsif ($sv->FLAGS & SVf_ROK && $sv->can("RV")) {
my $ref = $sv->RV;
- if (class($ref) eq "AV") {
+ my $class = class($ref);
+ if ($class eq "AV") {
return "[" . $self->list_const(2, $ref->ARRAY) . "]";
- } elsif (class($ref) eq "HV") {
+ } elsif ($class eq "HV") {
my %hash = $ref->ARRAY;
my @elts;
for my $k (sort keys %hash) {
push @elts, "$k => " . $self->const($hash{$k}, 6);
}
return "{" . join(", ", @elts) . "}";
- } elsif (class($ref) eq "CV") {
+ } elsif ($class eq "CV") {
BEGIN {
if ($] > 5.0150051) {
require overloading;
}
return "sub " . $self->deparse_sub($ref);
}
- if ($ref->FLAGS & SVs_SMG) {
+ if ($class ne 'SPECIAL' and $ref->FLAGS & SVs_SMG) {
for (my $mg = $ref->MAGIC; $mg; $mg = $mg->MOREMAGIC) {
if ($mg->TYPE eq 'r') {
my $re = re_uninterp(escape_re(re_unback($mg->precomp)));
use warnings;
use strict;
-my $tests = 44; # not counting those in the __DATA__ section
+my $tests = 45; # not counting those in the __DATA__ section
use B::Deparse;
my $deparse = B::Deparse->new();
qr/^sub foo \{\s+foo\(\)/m,
'recursive sub';
+is runperl(stderr => 1, switches => [ '-MO=-qq,Deparse', $path ],
+ prog => 'BEGIN { $::{f}=\!0 }'),
+ "sub BEGIN {\n \$main::{'f'} = \\1;\n}\n",
+ '&PL_sv_yes constant (used to croak)';
+
is runperl(stderr => 1, switches => [ '-MO=-qq,Deparse', $path, '-T' ],
prog => '$x =~ (1?/$a/:0)'),
'$x =~ ($_ =~ /$a/);'."\n",