diff options
author | Yves Orton <demerphq@gmail.com> | 2022-10-31 14:41:27 +0100 |
---|---|---|
committer | Yves Orton <demerphq@gmail.com> | 2022-11-01 11:57:31 +0100 |
commit | 6848aea2c844896efb347e6a210098c7dd447567 (patch) | |
tree | fd5ac721106fe55e061272248af6c7982bf1966a /mg.c | |
parent | 4bd3be3563698eb6e927a62c29755b216b926a27 (diff) | |
download | perl-6848aea2c844896efb347e6a210098c7dd447567.tar.gz |
op.c - use refcounted pv pointers for cop_warnings
this allows multiple ops to share the same underlying
warning bit vector. the vectors are not deduped, however
they are efficiently copied and shared.
Diffstat (limited to 'mg.c')
-rw-r--r-- | mg.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -3033,9 +3033,11 @@ Perl_magic_set(pTHX_ SV *sv, MAGIC *mg) STRLEN len; const char *const p = SvPV_const(sv, len); - PL_compiling.cop_warnings - = Perl_new_warnings_bitfield(aTHX_ PL_compiling.cop_warnings, - p, len); + free_and_set_cop_warnings( + &PL_compiling, + Perl_new_warnings_bitfield(aTHX_ PL_compiling.cop_warnings, + p, len) + ); if (isWARN_on(PL_compiling.cop_warnings, WARN_ONCE)) PL_dowarn |= G_WARN_ONCE ; |