X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=xs-src%2FMouseUtil.xs;h=3ec7d8cf4a4bc7a737ee9f96a7d349855cb1d8a4;hb=31aa6299ca20515174f1b145e5b3d4dbd9e09a08;hp=2d557a6c81331fa1039a68942a1cac2244eb8967;hpb=d6ceb359d08b474a9f0911c7d7c3fd319761b0ae;p=gitmo%2FMouse.git diff --git a/xs-src/MouseUtil.xs b/xs-src/MouseUtil.xs index 2d557a6..3ec7d8c 100644 --- a/xs-src/MouseUtil.xs +++ b/xs-src/MouseUtil.xs @@ -112,10 +112,13 @@ mouse_throw_error(SV* const metaobject, SV* const data /* not used */, const cha 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); } } @@ -320,7 +323,7 @@ mouse_install_sub(pTHX_ GV* const gv, SV* const code_ref) { if(GvCVu(gv)){ /* delete *slot{gv} to work around "redefine" warning */ SvREFCNT_dec(GvCV(gv)); - GvCV(gv) = NULL; + GvCV_set(gv, NULL); } sv_setsv_mg((SV*)gv, code_ref); /* *gv = $code_ref */