]> git.vpit.fr Git - perl/modules/indirect.git/blobdiff - indirect.xs
Make indirect play nice with Devel::CallParser
[perl/modules/indirect.git] / indirect.xs
index 1bd3ffa662c923708e18167f4f2de0d1069a8257..4f7ac3a9721c19e5abd772d107920c3eb52fa419 100644 (file)
@@ -182,10 +182,10 @@ typedef SV indirect_hint_t;
  * thread cleanup. */
 
 typedef struct {
+ char   *buf;
  STRLEN  pos;
  STRLEN  size;
  STRLEN  len;
- char   *buf;
  line_t  line;
 } indirect_op_info_t;
 
@@ -394,6 +394,11 @@ STATIC SV *indirect_hint(pTHX) {
  if (IN_PERL_RUNTIME)
   return NULL;
 
+#if I_HAS_PERL(5, 10, 0) || defined(PL_parser)
+ if (!PL_parser)
+  return NULL;
+#endif
+
 #ifdef cop_hints_fetch_pvn
  hint = cop_hints_fetch_pvn(PL_curcop, __PACKAGE__, __PACKAGE_LEN__,
                                                               indirect_hash, 0);