Skip to content

Commit 5489010

Browse files
authored
[Flang-rt] Implement same behavior as -O3 for zero-length arrays (#171480)
1 parent dc8fde0 commit 5489010

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

flang-rt/lib/runtime/assign.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ RT_API_ATTRS int AssignTicket::Begin(WorkQueue &workQueue) {
366366
"assignment to unallocated allocatable",
367367
to_.rank(), from_->rank());
368368
}
369-
} else if (!to_.IsAllocated()) {
369+
} else if (!to_.IsAllocated() && to_.Elements()) {
370370
workQueue.terminator().Crash(
371371
"Assign: left-hand side variable is neither allocated nor allocatable");
372372
}

0 commit comments

Comments
 (0)