mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-13 08:46:22 +00:00
[flang][runtime] Fix recently broken big-endian formatted integer input (#135417)
My recent change to speed up formatted integer input has a bug on big-endian targets that has shown up on ppc64 AIX build bots. Fix.
This commit is contained in:
parent
a45b133d40
commit
72144d119a
@ -293,8 +293,8 @@ RT_API_ATTRS bool EditIntegerInput(IoStatementState &io, const DataEdit &edit,
|
||||
#if USING_NATIVE_INT128_T
|
||||
auto shft{static_cast<int>(sizeof value - kind)};
|
||||
if (!isHostLittleEndian && shft >= 0) {
|
||||
auto l{value << shft};
|
||||
std::memcpy(n, &l, kind);
|
||||
auto shifted{value << (8 * shft)};
|
||||
std::memcpy(n, &shifted, kind);
|
||||
} else {
|
||||
std::memcpy(n, &value, kind); // a blank field means zero
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user