diff options
author | Alex Vandiver <alexmv@mit.edu> | 2003-05-02 02:45:05 -0400 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2003-05-12 21:49:21 +0000 |
commit | 31ed3de4cb852f713b0c993e8402aaafa6b6412c (patch) | |
tree | c42d11b1dcf1a112af0ecb9f209acb0f8b67e145 /sv.c | |
parent | bd66e09381e758ce2b7f22998a9bb3dd1d065efb (diff) | |
download | perl-31ed3de4cb852f713b0c993e8402aaafa6b6412c.tar.gz |
Re: Bug stomping fun. [PATCH: bug #1016]
Message-Id: <1051872303.26203.104.camel@supox>
(plus perldiag nit)
p4raw-id: //depot/perl@19505
Diffstat (limited to 'sv.c')
-rw-r--r-- | sv.c | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -3080,7 +3080,10 @@ Perl_sv_2pv_flags(pTHX_ register SV *sv, STRLEN *lp, I32 flags) } tsv = NEWSV(0,0); if (SvOBJECT(sv)) - Perl_sv_setpvf(aTHX_ tsv, "%s=%s", HvNAME(SvSTASH(sv)), s); + if (HvNAME(SvSTASH(sv))) + Perl_sv_setpvf(aTHX_ tsv, "%s=%s", HvNAME(SvSTASH(sv)), s); + else + Perl_sv_setpvf(aTHX_ tsv, "__ANON__=%s", s); else sv_setpv(tsv, s); Perl_sv_catpvf(aTHX_ tsv, "(0x%"UVxf")", PTR2UV(sv)); @@ -7773,7 +7776,10 @@ char * Perl_sv_reftype(pTHX_ SV *sv, int ob) { if (ob && SvOBJECT(sv)) { - return HvNAME(SvSTASH(sv)); + if (HvNAME(SvSTASH(sv))) + return HvNAME(SvSTASH(sv)); + else + return "__ANON__"; } else { switch (SvTYPE(sv)) { @@ -7851,6 +7857,8 @@ Perl_sv_isa(pTHX_ SV *sv, const char *name) sv = (SV*)SvRV(sv); if (!SvOBJECT(sv)) return 0; + if (!HvNAME(SvSTASH(sv))) + return 0; return strEQ(HvNAME(SvSTASH(sv)), name); } |