This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
sv_vcatpvfn_flags() Balance LC_NUMERIC changes/restores
authorKarl Williamson <khw@cpan.org>
Wed, 17 Jan 2018 20:00:44 +0000 (13:00 -0700)
committerKarl Williamson <khw@cpan.org>
Wed, 31 Jan 2018 05:49:03 +0000 (22:49 -0700)
Prior to this commit, the restore for LC_NUMERIC was getting called even
if there were no corresponding store.  Change so they are balanced; a
future commit will require this.

sv.c

diff --git a/sv.c b/sv.c
index 58d4bf6..bd655d0 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -13329,8 +13329,10 @@ Perl_sv_vcatpvfn_flags(pTHX_ SV *const sv, const char *const pat, const STRLEN p
 
     SvTAINT(sv);
 
-    RESTORE_LC_NUMERIC();   /* Done outside loop, so don't have to save/restore
-                               each iteration. */
+    if (lc_numeric_set) {
+        RESTORE_LC_NUMERIC();   /* Done outside loop, so don't have to
+                                   save/restore each iteration. */
+    }
 }
 
 /* =========================================================================