Skip to content

Conversation

klausler
Copy link
Contributor

Ensure that blank padding takes place when a fixed-length character allocatable is allocated with a short SOURCE= specifier. While here, clean up DoFromSourceAssign() so that it uses a temporary descriptor on the stack rather than allocating one from the heap.

Fixes #155703.

Ensure that blank padding takes place when a fixed-length character
allocatable is allocated with a short SOURCE= specifier.  While
here, clean up DoFromSourceAssign() so that it uses a temporary
descriptor on the stack rather than allocating one from the heap.

Fixes llvm#155703.
@llvmbot llvmbot added the flang Flang issues not falling into any other category label Aug 27, 2025
for (std::size_t n{alloc.InlineElements()}; n-- > 0;
alloc.IncrementSubscripts(allocAt)) {
Descriptor allocElement{*Descriptor::Create(*allocDerived,
reinterpret_cast<void *>(alloc.Element<char>(allocAt)), 0)};
StaticDescriptor<maxRank, true, 8 /*?*/> statDesc;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why /*?*/ ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because we still don't have a good implementation of LEN PDT parameters and I'm never sure how many to allocate for when instantiating StaticDesc.

Copy link
Contributor

@DanielCChen DanielCChen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flang Flang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[flang] String comparison failure with allocatable character type object
5 participants