-
Notifications
You must be signed in to change notification settings - Fork 577
[PATCH] locale.c: cast to char before comparing with a char constant #16989
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
From [email protected]From: jerome.duval@gmail.com This is a multi-part message in MIME format. This is a bug report for perl from jerome.duval@gmail.com, locale.c: the corruption check for the utf8ness_cache should cast Flags: Site configuration information for perl 5.29.10: Configured by korli at Sat May 4 12:06:04 CEST 2019. Summary of my perl5 (revision 5 version 29 subversion 10) configuration: Locally applied patches: @INC for perl 5.29.10: Environment for perl 5.29.10: --------------1.41.perlbug From 5433b288b31a6509217b8c047cac1150f6dcabeb Mon Sep 17 00:00:00 2001 exposed by gcc 2.95. locale.c | 2 +- Inline Patchdiff --git a/locale.c b/locale.c
index 87e11d609d..756bd44334 100644
--- a/locale.c
+++ b/locale.c
@@ -5052,7 +5052,7 @@ Perl__is_cur_LC_category_utf8(pTHX_ int category)
Copy(delimited, utf8ness_cache, input_name_len_with_overhead
- 1, char);
utf8ness_cache[input_name_len_with_overhead - 1] = is_utf8 + '0';
- if ((PL_locale_utf8ness[strlen(PL_locale_utf8ness)-1]
+ if ((char)(PL_locale_utf8ness[strlen(PL_locale_utf8ness)-1]
& (PERL_UINTMAX_T) ~1) != '0')
{
Perl_croak(aTHX_
--
--------------1.41.perlbug-- |
From @jkeenanOn Sat, 04 May 2019 11:00:46 GMT, jerome.duval@gmail.com wrote:
1. Can you provide (as an attachment) the part of the 'make' output where this failure appears? 2. Can you re-send your patch as an attachment (rather than inline)? (That is easier for us to apply for testing in a branch.) 3. Does anyone have an explanation as to why this failure does not appear with C compilers released since 1999? Thank you very much. -- |
The RT System itself - Status changed from 'new' to 'open' |
From [email protected]Am Sun, 05 May 2019 05:38:06 -0700, jkeenan schrieb:
The build doesn't fail, the code produced does. The corruption check fails, it means it doesn't compare correctly the '0' character whereas the value is correct.
Attached.
At least the impacted code was introduced since 5.26. Maybe it wasn't |
From [email protected]0001-locale.c-cast-to-char-before-comparing-with-a-char-c.patchFrom 5433b288b31a6509217b8c047cac1150f6dcabeb Mon Sep 17 00:00:00 2001
From: Jerome Duval <[email protected]>
Date: Thu, 25 Apr 2019 23:19:43 +0200
Subject: [PATCH] locale.c: cast to char before comparing with a char constant.
exposed by gcc 2.95.
---
locale.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/locale.c b/locale.c
index 87e11d609d..756bd44334 100644
--- a/locale.c
+++ b/locale.c
@@ -5052,7 +5052,7 @@ Perl__is_cur_LC_category_utf8(pTHX_ int category)
Copy(delimited, utf8ness_cache, input_name_len_with_overhead - 1, char);
utf8ness_cache[input_name_len_with_overhead - 1] = is_utf8 + '0';
- if ((PL_locale_utf8ness[strlen(PL_locale_utf8ness)-1]
+ if ((char)(PL_locale_utf8ness[strlen(PL_locale_utf8ness)-1]
& (PERL_UINTMAX_T) ~1) != '0')
{
Perl_croak(aTHX_
--
2.17.1
|
From @tonycozFor anyone following along via RT this has had further discussion on the list: https://www.nntp.perl.org/group/perl.perl5.porters/2019/05/msg254741.html that hasn't made it to the ticket so far, due to the perl.org maintenance. This includes a new patch. This hasn't been patched in blead due to the release freeze. Tony |
From @khwilliamsonFixed by commit 72299e0 * locale.c: remove unnecessary cast -- |
@khwilliamson - Status changed from 'open' to 'pending release' |
Migrated from rt.perl.org#134080 (status was 'pending release')
Searchable as RT134080$
The text was updated successfully, but these errors were encountered: