This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
ckDEAD: PL_curcop->cop_warnings only if PL_curcop
[perl5.git] / regen / warnings.pl
index 83bf8bc..5721c17 100644 (file)
@@ -462,7 +462,8 @@ is by default enabled even if not within the scope of S<C<use warnings>>.
 #define unpackWARN4(x)         (((x) >>24) & 0xFF)
 
 #define ckDEAD(x)                                                      \
-          ( ! specialWARN(PL_curcop->cop_warnings) &&                  \
+          (PL_curcop &&                                                \
+            !specialWARN(PL_curcop->cop_warnings) &&                   \
            ( isWARNf_on(PL_curcop->cop_warnings, WARN_ALL) ||          \
              isWARNf_on(PL_curcop->cop_warnings, unpackWARN1(x)) ||    \
              isWARNf_on(PL_curcop->cop_warnings, unpackWARN2(x)) ||    \