Revision: 1150
Author: [email protected]
Date: Mon Mar  8 01:50:35 2010
Log: Move callback type checking into load_profile_to_callback().
http://code.google.com/p/perl-devel-nytprof/source/detail?r=1150

Modified:
 /trunk/NYTProf.xs

=======================================
--- /trunk/NYTProf.xs   Mon Mar  8 01:50:31 2010
+++ /trunk/NYTProf.xs   Mon Mar  8 01:50:35 2010
@@ -4588,6 +4588,9 @@
     Loader_state_callback state;
     int i;

+    if (SvTYPE(cb) != SVt_PVCV)
+        croak("Not a CODE reference");
+
 #ifdef MULTIPLICITY
     state.interp = my_perl;
 #endif
@@ -4805,8 +4808,6 @@
         croak("Failed to open input '%s': %s", file, strerror(errno));
     }
     if (cb && SvROK(cb)) {
-        if (SvTYPE(SvRV(cb)) != SVt_PVCV)
-            croak("Not a CODE reference");
         load_profile_to_callback(aTHX_ in, (CV *)SvRV(cb));
         RETVAL = newHV(); /* Can we change this to PL_sv_undef?  */
     } else

--
You've received this message because you are subscribed to
the Devel::NYTProf Development User group.

Group hosted at:  http://groups.google.com/group/develnytprof-dev
Project hosted at:  http://perl-devel-nytprof.googlecode.com
CPAN distribution:  http://search.cpan.org/dist/Devel-NYTProf

To post, email:  [email protected]
To unsubscribe, email:  [email protected]

Reply via email to