summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2017-08-08 09:53:13 +0100
committerDavid Mitchell <davem@iabyn.com>2017-08-08 09:53:13 +0100
commitc8eaeaeca3cef30e45c15e87125a03a0ac0e01f9 (patch)
treeb90091f9d53df539e450264fe6198da413d20723
parent9c6b56dc65cdd9256fbe04a7baf4f085db1c04dd (diff)
downloadperl-c8eaeaeca3cef30e45c15e87125a03a0ac0e01f9.tar.gz
Revert "Perl_sv_vcatpvfn_flags: skip IN_LC(LC_NUMERIC)"
This reverts commit c10a72e1914795f6399890aafae13734552645cd. I thought that if PL_numeric_radix_sv is true, then IN_LC(LC_NUMERIC) must be true, so no need to test for both. So I replaced the expensive IN_LC(LC_NUMERIC) test with an assert. But in http://nntp.perl.org/group/perl.perl5.porters/245455, Karl points out that the assert is triggering on HP-UX. So there's something wrong with my logic something. So revert.
-rw-r--r--sv.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/sv.c b/sv.c
index 087fc73f89..c370f973a3 100644
--- a/sv.c
+++ b/sv.c
@@ -11767,10 +11767,9 @@ S_format_hexfp(pTHX_ char * const buf, const STRLEN bufsize, const char c,
#ifndef USE_LOCALE_NUMERIC
*p++ = '.';
#else
- if (PL_numeric_radix_sv) {
+ if (PL_numeric_radix_sv && IN_LC(LC_NUMERIC)) {
STRLEN n;
const char* r = SvPV(PL_numeric_radix_sv, n);
- assert(IN_LC(LC_NUMERIC));
Copy(r, p, n, char);
p += n;
}
@@ -12963,8 +12962,7 @@ Perl_sv_vcatpvfn_flags(pTHX_ SV *const sv, const char *const pat, const STRLEN p
lc_numeric_set = TRUE;
}
- if (PL_numeric_radix_sv) {
- assert(IN_LC(LC_NUMERIC));
+ if (PL_numeric_radix_sv && IN_LC(LC_NUMERIC)) {
/* this can't wrap unless PL_numeric_radix_sv is a string
* consuming virtually all the 32-bit or 64-bit address
* space