This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Skip PL_warn_locale use unless compiled in
authorKarl Williamson <khw@cpan.org>
Sat, 7 Mar 2015 19:14:36 +0000 (12:14 -0700)
committerKarl Williamson <khw@cpan.org>
Sat, 7 Mar 2015 19:19:56 +0000 (12:19 -0700)
The use of this variable was inconsistent.  It was not dup'ed on thread
cloning unless LC_CTYPE is being used, but elsewhere it was.  This led
to segfaults on threaded builds.  Now it isn't touched anywhere unless
LC_CTYPE is used.

intrpvar.h
perl.c

index 83789d5..40134dd 100644 (file)
@@ -238,7 +238,9 @@ PERLVAR(I, exit_flags,      U8)             /* was exit() unexpected, etc. */
 
 PERLVAR(I, utf8locale, bool)           /* utf8 locale detected */
 PERLVAR(I, in_utf8_CTYPE_locale, bool)
-PERLVAR(I, warn_locale, SV *)
+#ifdef USE_LOCALE_CTYPE
+    PERLVAR(I, warn_locale, SV *)
+#endif
 
 PERLVARA(I, colors,6,  char *)         /* values from PERL_RE_COLORS env var */
 
diff --git a/perl.c b/perl.c
index 1a603ae..5cc8cdc 100644 (file)
--- a/perl.c
+++ b/perl.c
@@ -1041,7 +1041,9 @@ perl_destruct(pTHXx)
     SvREFCNT_dec(PL_Latin1);
     SvREFCNT_dec(PL_NonL1NonFinalFold);
     SvREFCNT_dec(PL_HasMultiCharFold);
+#ifdef USE_LOCALE_CTYPE
     SvREFCNT_dec(PL_warn_locale);
+#endif
     PL_utf8_mark       = NULL;
     PL_utf8_toupper    = NULL;
     PL_utf8_totitle    = NULL;
@@ -1053,7 +1055,9 @@ perl_destruct(pTHXx)
     PL_AboveLatin1       = NULL;
     PL_InBitmap          = NULL;
     PL_HasMultiCharFold  = NULL;
+#ifdef USE_LOCALE_CTYPE
     PL_warn_locale       = NULL;
+#endif
     PL_Latin1            = NULL;
     PL_NonL1NonFinalFold = NULL;
     PL_UpperLatin1       = NULL;