From: Jesse Luehrs Date: Fri, 5 Aug 2011 19:44:11 +0000 (-0500) Subject: don't allow assigning globs as scalars X-Git-Tag: 0.23~4 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5a4d63bd5f5f484ca406b6cf7f6c8d0fb9326a0a;p=gitmo%2FPackage-Stash-XS.git don't allow assigning globs as scalars --- diff --git a/XS.xs b/XS.xs index 2c9639e..8c84081 100644 --- a/XS.xs +++ b/XS.xs @@ -241,7 +241,11 @@ static int _valid_for_type(SV *value, vartype_t type) switch (type) { case VAR_SCALAR: - return SVT_SCALAR(sv_type); + /* XXX is a glob a scalar? assigning a glob to the scalar slot seems + * to work here, but in pure perl i'm pretty sure it goes to the EGV + * slot, which seems more correct to me. just disable it for now + * i guess */ + return SVT_SCALAR(sv_type) && sv_type != SVt_PVGV; case VAR_ARRAY: return SVT_ARRAY(sv_type); case VAR_HASH: