[libc-commits] [libc] [libc][z/OS] Remove ASCII trick to fix EBDIC std::from_char (PR #116078)
via libc-commits
libc-commits at lists.llvm.org
Wed Nov 13 08:30:01 PST 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-libc
Author: Zibi Sarbinowski (zibi2)
<details>
<summary>Changes</summary>
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.
---
Full diff: https://github.com/llvm/llvm-project/pull/116078.diff
1 Files Affected:
- (modified) libc/src/__support/high_precision_decimal.h (+2-1)
``````````diff
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] == '-') {
``````````
</details>
https://github.com/llvm/llvm-project/pull/116078
More information about the libc-commits
mailing list