Use sv_true() instead of SvTRUE(), which is too large to inline
[gitmo/Mouse.git] / xs-src / Mouse.xs
index b3d411c..a7d8dec 100644 (file)
@@ -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;
 
@@ -629,7 +633,7 @@ CODE:
             PUTBACK;
 
             call_sv(AvARRAY(demolishall)[i], G_VOID | G_DISCARD | G_EVAL);
-            if(SvTRUE(ERRSV)){
+            if(sv_true(ERRSV)){
                 SV* const e = newSVsv(ERRSV);
 
                 FREETMPS;
@@ -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);
 }