From: Graham Barr Date: Thu, 29 Aug 1996 06:05:10 +0000 (+0000) Subject: Re: UNIVERSAL::class busted X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=bf3f28f2f1de2d93e00d5b74b50e8eaa798fc0c2;p=p5sagit%2Fp5-mst-13.2.git 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 --- diff --git a/universal.c b/universal.c index 61a536b..72087e6 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);