summaryrefslogtreecommitdiffstats
path: root/XS.xs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2011-09-05 20:17:03 -0500
committerJesse Luehrs <doy@tozt.net>2011-09-05 20:17:03 -0500
commit1ff84a326d0d713e63382bbe164adbb6b4902a1b (patch)
tree38b2e5f592ce2dff65fb5687d5506a4f454b8b71 /XS.xs
parent1aa4d5a886cb9a54d4bba8cc4c585df36777cf18 (diff)
downloadpackage-stash-xs-1ff84a326d0d713e63382bbe164adbb6b4902a1b.tar.gz
package-stash-xs-1ff84a326d0d713e63382bbe164adbb6b4902a1b.zip
don't allow variable names that contain ::
Diffstat (limited to 'XS.xs')
-rw-r--r--XS.xs7
1 files changed, 7 insertions, 0 deletions
diff --git a/XS.xs b/XS.xs
index 8c84081..60775b7 100644
--- a/XS.xs
+++ b/XS.xs
@@ -235,6 +235,13 @@ static void _deconstruct_variable_hash(HV *variable, varspec_t *varspec)
varspec->type = string_to_vartype(SvPV_nolen(HeVAL(val)));
}
+static void _check_varspec_is_valid(varspec_t *varspec)
+{
+ if (strstr(SvPV_nolen(varspec->name), "::")) {
+ croak("Variable names may not contain ::");
+ }
+}
+
static int _valid_for_type(SV *value, vartype_t type)
{
svtype sv_type = SvROK(value) ? SvTYPE(SvRV(value)) : SVt_NULL;