diff options
author | David Mitchell <davem@iabyn.com> | 2017-01-23 13:27:07 +0000 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2017-01-23 13:52:36 +0000 |
commit | b1a69a65ecd83426da7ca1af26b757fe0da58007 (patch) | |
tree | 17e4aba33dae2be88f35f6bd8e9b12b11f5cc129 /warnings.h | |
parent | 03fedefe18733baa9ed7c9c22bd816408d57de0d (diff) | |
download | perl-b1a69a65ecd83426da7ca1af26b757fe0da58007.tar.gz |
ckDEAD: PL_curcop->cop_warnings only if PL_curcop
RT #130621
In ckDEAD(), don't check the value of PL_curcop->cop_warnings unless
PL_curcop is non-null.
In the ticket above, the reason that PL_curcop is null is the less
than optimal way that evals free their optree: ideally the optree should
be attached to the eval CV and freed when the CV is; instead a separate
SAVEFREEOP() is done. But that fix is for another time; regardless,
ckDEAD() should have a PL_curcop != NULL guard anyway like isLEXWARN_on()
etc already do.
Diffstat (limited to 'warnings.h')
-rw-r--r-- | warnings.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/warnings.h b/warnings.h index 6d675209f8..01668377fc 100644 --- a/warnings.h +++ b/warnings.h @@ -221,7 +221,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)) || \ |