diff options
author | Graham Barr <bodg@tiuk.ti.com> | 1996-08-29 06:05:10 +0000 |
---|---|---|
committer | Andy Dougherty <doughera@lafcol.lafayette.edu> | 1996-08-29 06:05:10 +0000 |
commit | bf3f28f2f1de2d93e00d5b74b50e8eaa798fc0c2 (patch) | |
tree | 92fdeea0d849708751bc7764e03cc56ea84f0d53 /universal.c | |
parent | 73a1c01a52169304137bbab43cdbe76faa9aae6d (diff) | |
download | perl-bf3f28f2f1de2d93e00d5b74b50e8eaa798fc0c2.tar.gz |
Re: UNIVERSAL::class busted
yes, but I also noticed that this does not check that the reference
is an object, so the patch should be
Diffstat (limited to 'universal.c')
-rw-r--r-- | universal.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/universal.c b/universal.c index 61a536b7fe..72087e62a8 100644 --- a/universal.c +++ b/universal.c @@ -154,9 +154,9 @@ static XS(XS_UNIVERSAL_class) { dXSARGS; - if(SvROK(ST(0))) { + if(SvROK(ST(0)) && SvOBJECT(SvRV(ST(0)))) { SV *sv = sv_newmortal(); - sv_setpv(sv, HvNAME(SvSTASH(ST(0)))); + sv_setpv(sv, HvNAME(SvSTASH(SvRV(ST(0))))); ST(0) = sv; } XSRETURN(1); |