mPUSHs(newSVpvs("depth"));
mPUSHi(-1);
}
-
PUTBACK;
-
- call_method("throw_error", G_VOID);
+ if(SvOK(metaobject)) {
+ call_method("throw_error", G_VOID);
+ }
+ else {
+ call_pv("Mouse::Util::throw_error", G_VOID);
+ }
croak("throw_error() did not throw the error (%"SVf")", message);
}
}
-/* workaround RT #69939 */
+/* workaround Perl-RT #69939 */
I32
mouse_call_sv_safe(pTHX_ SV* const sv, I32 const flags) {
- assert( (flags & G_EVAL) == 0 );
+ I32 count;
+ ENTER;
+ /* Don't do SAVETMPS */
- if(!PL_in_eval) {
- I32 count;
- SAVESPTR(ERRSV);
- ERRSV = sv_newmortal();
+ SAVESPTR(ERRSV);
+ ERRSV = sv_newmortal();
- count = Perl_call_sv(aTHX_ sv, flags | G_EVAL);
+ count = Perl_call_sv(aTHX_ sv, flags | G_EVAL);
- if(sv_true(ERRSV)){
- croak(NULL); /* rethrow */
- }
- return count;
- }
- else {
- return Perl_call_sv(aTHX_ sv, flags);
+ if(sv_true(ERRSV)){
+ SV* const err = sv_mortalcopy(ERRSV);
+ LEAVE;
+ sv_setsv(ERRSV, err);
+ croak(NULL); /* rethrow */
}
+
+ LEAVE;
+
+ return count;
}
void
}
}
- CvGV(cv) = gv;
+ CvGV_set(cv, gv);
CvANON_off(cv);
}
}