diff options
author | Abhijit Menon-Sen <ams@wiw.org> | 2001-11-03 03:45:19 +0000 |
---|---|---|
committer | Abhijit Menon-Sen <ams@wiw.org> | 2001-11-03 03:45:19 +0000 |
commit | c86bf3738f7c11cf104e47bcf1593b2856268b80 (patch) | |
tree | 4737d102c284e1b5848051fbcb1897162c8043e7 /sv.c | |
parent | 7114a2d26db82c459c722352adf0625e3ae9f42d (diff) | |
download | perl-c86bf3738f7c11cf104e47bcf1593b2856268b80.tar.gz |
Ugly bandaid to stop C<package;> from segfaulting (remember to
remove this later). Based on a patch from Robert Spier in
<15330.61459.14452.795263@rls.cx>.
p4raw-id: //depot/perl@12827
Diffstat (limited to 'sv.c')
-rw-r--r-- | sv.c | 19 |
1 files changed, 15 insertions, 4 deletions
@@ -3004,8 +3004,15 @@ Perl_sv_2pv_flags(pTHX_ register SV *sv, STRLEN *lp, I32 flags) default: s = "UNKNOWN"; break; } tsv = NEWSV(0,0); - if (SvOBJECT(sv)) - Perl_sv_setpvf(aTHX_ tsv, "%s=%s", HvNAME(SvSTASH(sv)), s); + if (SvOBJECT(sv)) { + HV *svs = SvSTASH(sv); + Perl_sv_setpvf( + aTHX_ tsv, "%s=%s", + /* [20011101.072] This bandaid for C<package;> + should eventually be removed. AMS 20011103 */ + (svs ? HvNAME(svs) : "<none>"), s + ); + } else sv_setpv(tsv, s); Perl_sv_catpvf(aTHX_ tsv, "(0x%"UVxf")", PTR2UV(sv)); @@ -6942,8 +6949,12 @@ Returns a string describing what the SV is a reference to. char * Perl_sv_reftype(pTHX_ SV *sv, int ob) { - if (ob && SvOBJECT(sv)) - return HvNAME(SvSTASH(sv)); + if (ob && SvOBJECT(sv)) { + HV *svs = SvSTASH(sv); + /* [20011101.072] This bandaid for C<package;> should eventually + be removed. AMS 20011103 */ + return (svs ? HvNAME(svs) : "<none>"); + } else { switch (SvTYPE(sv)) { case SVt_NULL: |