From: Jesse Luehrs Date: Wed, 5 Jan 2011 19:05:28 +0000 (-0600) Subject: use correct scalar test (reported by Roland van Ipenburg) X-Git-Tag: 0.18 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=32107d99dbb23f635a2c1665eedf250d7ecad852;p=gitmo%2FPackage-Stash-XS.git use correct scalar test (reported by Roland van Ipenburg) --- diff --git a/Changes b/Changes index dc4f256..9aeb67f 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,7 @@ Revision history for Package-Stash {{$NEXT}} + - more correct validity test for scalars (rafl, Roland van Ipenburg) 0.17 2010-11-16 - bah, get rid of extra junk in the tarball diff --git a/XS.xs b/XS.xs index 5957b1a..a32ca45 100644 --- a/XS.xs +++ b/XS.xs @@ -213,11 +213,7 @@ int _valid_for_type(SV *value, vartype_t type) switch (type) { case VAR_SCALAR: - return sv_type == SVt_NULL || - sv_type == SVt_IV || - sv_type == SVt_NV || - sv_type == SVt_PV || - sv_type == SVt_RV; + return SvROK(value) ? SvOK(SvRV(value)) : SvOK(value); case VAR_ARRAY: return sv_type == SVt_PVAV; case VAR_HASH: