X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=xs-src%2FMouse.xs;h=619844b2be7c49ba735f1bbbb6975a973d93c4d2;hb=5bc4e0be9bbb708110180a33ab779caf68d93aa3;hp=979fcd3353bc85eef6745abe2a94fa1139e6be35;hpb=f10b7c0fd9728b06eb9e8a7421f6da6ae94f7163;p=gitmo%2FMouse.git diff --git a/xs-src/Mouse.xs b/xs-src/Mouse.xs index 979fcd3..619844b 100644 --- a/xs-src/Mouse.xs +++ b/xs-src/Mouse.xs @@ -397,7 +397,7 @@ mouse_buildall(pTHX_ AV* const xc, SV* const object, SV* const args) { PUSHs(args); PUTBACK; - call_sv(AvARRAY(buildall)[i], G_VOID); + call_sv_safe(AvARRAY(buildall)[i], G_VOID); /* discard a scalar which G_VOID returns */ SPAGAIN; @@ -513,6 +513,7 @@ CODE: /* *{$package . '::' . $name} -> *gv */ gv = gv_fetchpv(form("%"SVf"::%"SVf, package, name), GV_ADDMULTI, SVt_PVCV); mouse_install_sub(aTHX_ gv, code_ref); + //CvMETHOD_on((CV*)SvRV(code_ref)); (void)set_slot(methods, name, code); /* $self->{methods}{$name} = $code */ } @@ -651,9 +652,10 @@ CODE: for(i = 0; i < items; i++){ PUSHs(ST(i)); } - //SP += items; + PUTBACK; - call_method("BUILDARGS", G_SCALAR); + call_method_safes("BUILDARGS", G_SCALAR); + SPAGAIN; args = POPs; PUTBACK; @@ -715,21 +717,21 @@ CODE: len = AvFILLp(demolishall) + 1; if(len > 0){ - GV* const statusvalue = gv_fetchpvs("?", 0, SVt_PV); + SV* const in_global_destruction = boolSV(PL_dirty); + SAVEI32(PL_statusvalue); /* local $? */ + PL_statusvalue = 0; - if(statusvalue){ /* it can be NULL */ - SAVESPTR(GvSV(statusvalue)); /* local $? */ - GvSV(statusvalue) = sv_newmortal(); - } SAVESPTR(ERRSV); /* local $@ */ - ERRSV = newSVpvs_flags("", SVs_TEMP); + ERRSV = sv_newmortal(); + + EXTEND(SP, 2); for(i = 0; i < len; i++){ SPAGAIN; PUSHMARK(SP); - XPUSHs(object); - XPUSHs(boolSV(PL_dirty)); + PUSHs(object); + PUSHs(in_global_destruction); PUTBACK; call_sv(AvARRAY(demolishall)[i], G_VOID | G_EVAL);