summaryrefslogtreecommitdiff
path: root/scope.c
diff options
context:
space:
mode:
authorNicolas R <atoomic@cpan.org>2020-03-10 11:14:04 -0600
committerTony Cook <tony@develop-help.com>2020-03-16 10:37:17 +1100
commit94c8b9c1f0f31f0e85c11a61ad166ea156ae2b3a (patch)
treefb8784fec659db0d521401acd43a18580870cffb /scope.c
parent7c1815b7942f8c7e3651d98060ca7a0760e6483c (diff)
downloadperl-94c8b9c1f0f31f0e85c11a61ad166ea156ae2b3a.tar.gz
Add macro to free and set cop_warnings
This is avoiding the boilerplate to free the cop_warning string when setting it.
Diffstat (limited to 'scope.c')
-rw-r--r--scope.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/scope.c b/scope.c
index e6a6237c68..ad8f8e764b 100644
--- a/scope.c
+++ b/scope.c
@@ -1448,9 +1448,7 @@ Perl_leave_scope(pTHX_ I32 base)
case SAVEt_COMPILE_WARNINGS:
a0 = ap[0];
- if (!specialWARN(PL_compiling.cop_warnings))
- PerlMemShared_free(PL_compiling.cop_warnings);
- PL_compiling.cop_warnings = (STRLEN*)a0.any_ptr;
+ free_and_set_cop_warnings(PL_compiling, (STRLEN*) a0.any_ptr);
break;
case SAVEt_PARSER: