[flang-commits] [PATCH] D127793: [flang][runtime] Make ASSOCIATED() conform with standard

Peter Klausler via Phabricator via flang-commits flang-commits at lists.llvm.org
Thu Jun 16 11:40:07 PDT 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rGe0e2a1175195: [flang][runtime] Make ASSOCIATED() conform with standard (authored by klausler).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D127793/new/

https://reviews.llvm.org/D127793

Files:
  flang/runtime/pointer.cpp


Index: flang/runtime/pointer.cpp
===================================================================
--- flang/runtime/pointer.cpp
+++ flang/runtime/pointer.cpp
@@ -165,8 +165,9 @@
   for (int j{0}; j < rank; ++j) {
     const Dimension &pDim{pointer.GetDimension(j)};
     const Dimension &tDim{target->GetDimension(j)};
-    if (pDim.Extent() != tDim.Extent() ||
-        pDim.ByteStride() != tDim.ByteStride()) {
+    auto pExtent{pDim.Extent()};
+    if (pExtent == 0 || pExtent != tDim.Extent() ||
+        (pExtent != 1 && pDim.ByteStride() != tDim.ByteStride())) {
       return false;
     }
   }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D127793.437637.patch
Type: text/x-patch
Size: 605 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20220616/0fdf5988/attachment.bin>


More information about the flang-commits mailing list