diff options
author | David Mitchell <davem@iabyn.com> | 2020-03-20 09:06:57 +0000 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2020-03-20 09:06:57 +0000 |
commit | 1943af6140f72047c5028b50f947b52f8998bebd (patch) | |
tree | a02ab1e3de087e1e3bc503d0da81238ad9e9c197 /regen | |
parent | b33ac5557cb0255702946345f30e9a5ef0e8d88f (diff) | |
download | perl-1943af6140f72047c5028b50f947b52f8998bebd.tar.gz |
fixup to free_and_set_cop_warnings()
v5.31.9-156-g94c8b9c1f0 introduced the free_and_set_cop_warnings()
macro. It's first argument expects a COP rather than a COP*. Its usage
in S_restore_cop_warnings(() is to modify PL_cucop, but in order to pass
a COP rather than a COP*, the original commit made a local copy of
PL_curcop and ended up inadvertently updating the copy instead.
This commit changes the maco so it expects a COP*, and updates the bulk
of its callers to use &PL_compiling rather than PL_compiling, and fixes
up S_restore_cop_warnings().
The symptoms were ASAN failures in a few test scripts including
uni/parser.t and ext/XS-APItest/t/handy0*.t.
(The S_restore_cop_warnings() function was only used by
Perl__force_out_malformed_utf8_message(), so didn't cause many issues
outside of test scripts which forced such "malformed "errors).
Diffstat (limited to 'regen')
-rw-r--r-- | regen/warnings.pl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/regen/warnings.pl b/regen/warnings.pl index a73ca9e3bb..6000c759ef 100644 --- a/regen/warnings.pl +++ b/regen/warnings.pl @@ -393,8 +393,8 @@ EOM #define DUP_WARNINGS(p) Perl_dup_warnings(aTHX_ p) #define free_and_set_cop_warnings(cmp,w) STMT_START { \ - if (!specialWARN(cmp.cop_warnings)) PerlMemShared_free(cmp.cop_warnings); \ - cmp.cop_warnings = w; \ + if (!specialWARN((cmp)->cop_warnings)) PerlMemShared_free((cmp)->cop_warnings); \ + (cmp)->cop_warnings = w; \ } STMT_END /* |