From: gfx Date: Sat, 9 Jan 2010 08:52:48 +0000 (+0900) Subject: Move tied hash checks X-Git-Tag: 0.46~2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMouse.git;a=commitdiff_plain;h=6463e8392727169e5bfb4b80f698611b95bee21f Move tied hash checks --- diff --git a/xs-src/Mouse.xs b/xs-src/Mouse.xs index b3d411c..372713d 100644 --- a/xs-src/Mouse.xs +++ b/xs-src/Mouse.xs @@ -249,6 +249,10 @@ mouse_class_initialize_object(pTHX_ SV* const meta, SV* const object, HV* const assert(args); assert(SvTYPE(args) == SVt_PVHV); + if(mg_find((SV*)args, PERL_MAGIC_tied)){ + croak("You cannot use tied HASH reference as initializing arguments"); + } + ENTER; SAVETMPS; @@ -663,8 +667,5 @@ CODE: if(!IsHashRef(args)){ croak("You must pass a HASH reference to BUILDALL"); } - if(mg_find(SvRV(args), PERL_MAGIC_tied)){ - croak("You cannot use tie HASH reference as args"); - } mouse_buildall(aTHX_ xc, self, args); }