diff options
author | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2003-01-15 20:34:52 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2003-01-15 20:34:52 +0000 |
commit | 253ecd6d4a439a0600720c59c5e6516a269933d8 (patch) | |
tree | a19f2694c7efebf6c8ce90099004ec6ddecf40b2 /universal.c | |
parent | 79628082eace9d4fea95d94e0f5a65aa9c61455c (diff) | |
download | perl-253ecd6d4a439a0600720c59c5e6516a269933d8.tar.gz |
isa() and can() didn't work on magic variables
see Message-Id: <20030114220737.2190ba7c.rgarciasuarez@free.fr>
plus a test case by B. Goldberg
p4raw-id: //depot/perl@18486
Diffstat (limited to 'universal.c')
-rw-r--r-- | universal.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/universal.c b/universal.c index 7999757f28..3e8d8b113b 100644 --- a/universal.c +++ b/universal.c @@ -232,7 +232,8 @@ XS(XS_UNIVERSAL_isa) if (SvGMAGICAL(sv)) mg_get(sv); - if (!SvOK(sv) || !(SvROK(sv) || (SvPOK(sv) && SvCUR(sv)))) + if (!SvOK(sv) || !(SvROK(sv) || (SvPOK(sv) && SvCUR(sv)) + || (SvGMAGICAL(sv) && SvPOKp(sv) && SvCUR(sv)))) XSRETURN_UNDEF; name = (char *)SvPV(ST(1),n_a); @@ -258,7 +259,8 @@ XS(XS_UNIVERSAL_can) if (SvGMAGICAL(sv)) mg_get(sv); - if (!SvOK(sv) || !(SvROK(sv) || (SvPOK(sv) && SvCUR(sv)))) + if (!SvOK(sv) || !(SvROK(sv) || (SvPOK(sv) && SvCUR(sv)) + || (SvGMAGICAL(sv) && SvPOKp(sv) && SvCUR(sv)))) XSRETURN_UNDEF; name = (char *)SvPV(ST(1),n_a); |