diff options
author | Father Chrysostomos <sprout@cpan.org> | 2016-07-11 14:49:17 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2016-07-11 17:15:20 -0700 |
commit | a2637ca0a3fec01b80d7ea5ba62802354fd5e6f3 (patch) | |
tree | 8fb368925bbe72db23bf38086f98653c9cd1a4ac /warnings.h | |
parent | d8cc0e431ef1b9fbf32d8df0b3ddfffef0fb3009 (diff) | |
download | perl-a2637ca0a3fec01b80d7ea5ba62802354fd5e6f3.tar.gz |
[perl #128597] Crash from gp_free/ckWARN_d
See the explanation in the test added and in the RT ticket.
The solution is to make the warn macros check that PL_curcop
is non-null.
Diffstat (limited to 'warnings.h')
-rw-r--r-- | warnings.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/warnings.h b/warnings.h index 337bef374c..4d137320bb 100644 --- a/warnings.h +++ b/warnings.h @@ -115,8 +115,10 @@ #define WARN_ALLstring "\125\125\125\125\125\125\125\125\125\125\125\125\125\125\125\125\125" #define WARN_NONEstring "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" -#define isLEXWARN_on cBOOL(PL_curcop->cop_warnings != pWARN_STD) -#define isLEXWARN_off cBOOL(PL_curcop->cop_warnings == pWARN_STD) +#define isLEXWARN_on \ + cBOOL(PL_curcop && PL_curcop->cop_warnings != pWARN_STD) +#define isLEXWARN_off \ + cBOOL(!PL_curcop || PL_curcop->cop_warnings == pWARN_STD) #define isWARN_ONCE (PL_dowarn & (G_WARN_ON|G_WARN_ONCE)) #define isWARN_on(c,x) (IsSet((U8 *)(c + 1), 2*(x))) #define isWARNf_on(c,x) (IsSet((U8 *)(c + 1), 2*(x)+1)) |