]> git.vpit.fr Git - perl/modules/indirect.git/blobdiff - indirect.xs
Only enable the pragma during compile time
[perl/modules/indirect.git] / indirect.xs
index 12e83d5c92ad1fe3b3c7265655371165cb69491d..45309ce648a1cf43b3b0cccd4a31b076d864a616 100644 (file)
@@ -351,6 +351,10 @@ STATIC U32 indirect_hash = 0;
 STATIC SV *indirect_hint(pTHX) {
 #define indirect_hint() indirect_hint(aTHX)
  SV *hint;
+
+ if (IN_PERL_RUNTIME)
+  return NULL;
+
 #if I_HAS_PERL(5, 9, 5)
  hint = Perl_refcounted_he_fetch(aTHX_ PL_curcop->cop_hints_hash,
                                        NULL,
@@ -358,11 +362,13 @@ STATIC SV *indirect_hint(pTHX) {
                                        0,
                                        indirect_hash);
 #else
- SV **val = hv_fetch(GvHV(PL_hintgv), __PACKAGE__, __PACKAGE_LEN__,
+ {
+  SV **val = hv_fetch(GvHV(PL_hintgv), __PACKAGE__, __PACKAGE_LEN__,
                                                                  indirect_hash);
- if (!val)
-  return 0;
- hint = *val;
+  if (!val)
+   return 0;
+  hint = *val;
+ }
 #endif
  return indirect_detag(hint);
 }