[flang-commits] [PATCH] D126139: [flang] Fix character length calculation for Unicode component
Peter Klausler via Phabricator via flang-commits
flang-commits at lists.llvm.org
Sat May 21 22:04:37 PDT 2022
klausler created this revision.
klausler added a reviewer: vdonaldson.
klausler added a project: Flang.
Herald added a subscriber: jdoerfert.
Herald added a project: All.
klausler requested review of this revision.
The character length value in the derived type component information table
entry is already in units of characters, not bytes, so don't divide by the
per-character byte size.
https://reviews.llvm.org/D126139
Files:
flang/runtime/type-info.cpp
Index: flang/runtime/type-info.cpp
===================================================================
--- flang/runtime/type-info.cpp
+++ flang/runtime/type-info.cpp
@@ -91,7 +91,7 @@
if (cat == TypeCategory::Character) {
std::size_t lengthInChars{0};
if (auto length{characterLen_.GetValue(&container)}) {
- lengthInChars = static_cast<std::size_t>(*length / kind_);
+ lengthInChars = static_cast<std::size_t>(*length);
} else {
RUNTIME_CHECK(
terminator, characterLen_.genre() == Value::Genre::Deferred);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D126139.431196.patch
Type: text/x-patch
Size: 554 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20220522/81632d1e/attachment.bin>
More information about the flang-commits
mailing list