[libc-commits] [libc] e25e886 - [libc][z/OS] Remove ASCII trick to fix EBDIC std::from_char (#116078)

via libc-commits libc-commits at lists.llvm.org
Wed Nov 13 11:40:01 PST 2024


Author: Zibi Sarbinowski
Date: 2024-11-13T14:39:57-05:00
New Revision: e25e8867348953c17fa0d0b79f43bde758ad8b37

URL: https://github.com/llvm/llvm-project/commit/e25e8867348953c17fa0d0b79f43bde758ad8b37
DIFF: https://github.com/llvm/llvm-project/commit/e25e8867348953c17fa0d0b79f43bde758ad8b37.diff

LOG: [libc][z/OS] Remove ASCII trick to fix EBDIC std::from_char (#116078)

This PR will fix the following lit in all EBCDIC variations on z/OS:
`std/utilities/charconv/charconv.from.chars/floating_point.pass.cpp`

The trick to test for `e` and `E` is working only in ASCII.
The fix is to simply test for both lower and upper case exponent letter
`e` and `E` respectfully.

Added: 
    

Modified: 
    libc/src/__support/high_precision_decimal.h

Removed: 
    


################################################################################
diff  --git a/libc/src/__support/high_precision_decimal.h b/libc/src/__support/high_precision_decimal.h
index ac11649d1d1686..20088d6d797910 100644
--- a/libc/src/__support/high_precision_decimal.h
+++ b/libc/src/__support/high_precision_decimal.h
@@ -350,7 +350,8 @@ class HighPrecisionDecimal {
     if (!saw_dot)
       this->decimal_point = total_digits;
 
-    if (num_cur < num_len && ((num_string[num_cur] | 32) == 'e')) {
+    if (num_cur < num_len &&
+        (num_string[num_cur] == 'e' || num_string[num_cur] == 'E')) {
       ++num_cur;
       if (isdigit(num_string[num_cur]) || num_string[num_cur] == '+' ||
           num_string[num_cur] == '-') {


        


More information about the libc-commits mailing list