X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMouse.git;a=blobdiff_plain;f=xs-src%2FMouseTypeConstraints.xs;h=8b94c85b383cc4a3299be8e58aa0bb0ff8a8f7e7;hp=08df0e8b0710c6dc34cd3b01a253a70a43e58335;hb=85a74fcf70600193f68dca0ca705bcf01e937d69;hpb=2053291d1c9bd8c8008259f872fbce78f97d040c diff --git a/xs-src/MouseTypeConstraints.xs b/xs-src/MouseTypeConstraints.xs index 08df0e8..8b94c85 100644 --- a/xs-src/MouseTypeConstraints.xs +++ b/xs-src/MouseTypeConstraints.xs @@ -16,11 +16,15 @@ typedef int (*check_fptr_t)(pTHX_ SV* const data, SV* const sv); +/* + NOTE: mouse_tc_check() handles GETMAGIC +*/ int mouse_tc_check(pTHX_ SV* const tc_code, SV* const sv) { CV* const cv = (CV*)SvRV(tc_code); assert(SvTYPE(cv) == SVt_PVCV); + SvGETMAGIC(sv); if(CvXSUB(cv) == XS_Mouse_constraint_check){ /* built-in type constraints */ MAGIC* const mg = (MAGIC*)CvXSUBANY(cv).any_ptr; @@ -244,7 +248,6 @@ mouse_parameterized_ArrayRef(pTHX_ SV* const param, SV* const sv) { I32 i; for(i = 0; i < len; i++){ SV* const value = *av_fetch(av, i, TRUE); - SvGETMAGIC(value); if(!mouse_tc_check(aTHX_ param, value)){ return FALSE; } @@ -263,7 +266,6 @@ mouse_parameterized_HashRef(pTHX_ SV* const param, SV* const sv) { hv_iterinit(hv); while((he = hv_iternext(hv))){ SV* const value = hv_iterval(hv, he); - SvGETMAGIC(value); if(!mouse_tc_check(aTHX_ param, value)){ hv_iterinit(hv); /* reset */ return FALSE;