summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorAbhijit Menon-Sen <ams@wiw.org>2001-11-03 03:45:19 +0000
committerAbhijit Menon-Sen <ams@wiw.org>2001-11-03 03:45:19 +0000
commitc86bf3738f7c11cf104e47bcf1593b2856268b80 (patch)
tree4737d102c284e1b5848051fbcb1897162c8043e7 /sv.c
parent7114a2d26db82c459c722352adf0625e3ae9f42d (diff)
downloadperl-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.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/sv.c b/sv.c
index 2da1291e41..74c3450180 100644
--- a/sv.c
+++ b/sv.c
@@ -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: