From: Fuji, Goro Date: Fri, 7 May 2010 05:25:08 +0000 (+0900) Subject: Workaround RT #57144, caused by Perl_call_sv()'s bug X-Git-Tag: 0.57~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9a87d68a97aa8d1dd0d14c1e63c0edcd03f0a13a;p=gitmo%2FMouse.git Workaround RT #57144, caused by Perl_call_sv()'s bug --- diff --git a/t/900_mouse_bugs/009_RT57144.t b/t/900_mouse_bugs/009_RT57144.t index d2660aa..ede5e1d 100644 --- a/t/900_mouse_bugs/009_RT57144.t +++ b/t/900_mouse_bugs/009_RT57144.t @@ -35,11 +35,7 @@ package main; use strict; use warnings; -pass 'The problem remains ...'; - -if(0) { - my $hoge = Hoge->new; - is $hoge->msg, "HOGE"; -} +my $hoge = Hoge->new; +is $hoge->msg, "HOGE"; done_testing; diff --git a/xs-src/MouseUtil.xs b/xs-src/MouseUtil.xs index 5b01e40..e562748 100644 --- a/xs-src/MouseUtil.xs +++ b/xs-src/MouseUtil.xs @@ -123,12 +123,13 @@ mouse_throw_error(SV* const metaobject, SV* const data /* not used */, const cha /* workaround RT #69939 */ I32 mouse_call_sv_safe(pTHX_ SV* const sv, I32 const flags) { + const PERL_CONTEXT* const cx = &cxstack[cxstack_ix]; assert( (flags & G_EVAL) == 0 ); - - if(!PL_in_eval) { + //warn("%d 0x%x 0x%x", (int)cx->cx_type, (int)cx->cx_type, (int)PL_in_eval); + if(!(cx->cx_type & (CXt_EVAL|CXp_TRYBLOCK))) { I32 count; - SAVESPTR(ERRSV); - ERRSV = sv_newmortal(); + //SAVESPTR(ERRSV); + //ERRSV = sv_newmortal(); count = Perl_call_sv(aTHX_ sv, flags | G_EVAL);