This is an archive of the discontinued LLVM Phabricator instance.

[flang][hlfir] Fixed NULL() handling in structure constructor.
ClosedPublic

Authored by vzakhari on Jul 10 2023, 4:48 PM.

Details

Summary

When an initializer value is missing for an allocatable component
in a structure constructor, the RHS is NULL() expression.
We should just skip this part of the initializer, since the component
must become unallocated (as it is from the initialization).
Runtime detected rank mismatch when we tried to pass NULL() box
RHS for assigning it to the unallocated component of rank 1, 2, etc.

Diff Detail

Event Timeline

vzakhari created this revision.Jul 10 2023, 4:48 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 10 2023, 4:48 PM
vzakhari requested review of this revision.Jul 10 2023, 4:48 PM
tblah accepted this revision.Jul 11 2023, 3:01 AM

LGTM

This revision is now accepted and ready to land.Jul 11 2023, 3:01 AM