X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMouse.git;a=blobdiff_plain;f=xs-src%2FMouseTypeConstraints.xs;h=2f4a6b125c599e51aac2c6de35e6f1faa0a52577;hp=741e679ce9b9b60e22643eb34376d5dcbd0d1c3b;hb=6fab29c627e6fa346e3aab08de0017b46eeb3ddb;hpb=327413ed22231607b5c0558bb7561a97158ce202 diff --git a/xs-src/MouseTypeConstraints.xs b/xs-src/MouseTypeConstraints.xs index 741e679..2f4a6b1 100644 --- a/xs-src/MouseTypeConstraints.xs +++ b/xs-src/MouseTypeConstraints.xs @@ -571,13 +571,11 @@ void compile_type_constraint(SV* self) CODE: { - AV* const checks = newAV(); + AV* const checks = newAV_mortal(); SV* check; /* check function */ SV* parent; SV* types_ref; - sv_2mortal((SV*)checks); - for(parent = get_slots(self, "parent"); parent; parent = get_slots(parent, "parent")){ check = get_slots(parent, "hand_optimized_type_constraint"); if(check && SvOK(check)){ @@ -621,8 +619,7 @@ CODE: types = (AV*)SvRV(types_ref); len = av_len(types) + 1; - union_checks = newAV(); - sv_2mortal((SV*)union_checks); + union_checks = newAV_mortal(); for(i = 0; i < len; i++){ SV* const tc = *av_fetch(types, i, TRUE);