diff options
Diffstat (limited to 'flang-rt/lib/runtime/pointer.cpp')
| -rw-r--r-- | flang-rt/lib/runtime/pointer.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/flang-rt/lib/runtime/pointer.cpp b/flang-rt/lib/runtime/pointer.cpp index 68db2594acdd..f8ada65541a1 100644 --- a/flang-rt/lib/runtime/pointer.cpp +++ b/flang-rt/lib/runtime/pointer.cpp @@ -267,8 +267,10 @@ bool RTDEF(PointerIsAssociatedWith)( if (!target) { return pointer.raw().base_addr != nullptr; } - if (!target->raw().base_addr || - (target->raw().type != CFI_type_struct && target->ElementBytes() == 0)) { + if (!target->raw().base_addr || target->ElementBytes() == 0 || + target->Elements() == 0) { + // F2023, 16.9.20, p5, case (v)-(vi): don't associate pointers with + // targets that have zero sized storage sequence. return false; } int rank{pointer.rank()}; |
