[PATCH] D113258: [flang] Set the addendum when establishing pointer section in descriptor

Jean Perier via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 5 03:36:12 PDT 2021


jeanPerier created this revision.
jeanPerier added reviewers: vdonaldson, klausler.
jeanPerier added a project: Flang.
Herald added a subscriber: jdoerfert.
jeanPerier requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

If the source has an addendum, the descriptor that is being established
to describe a section over the source needs to copy the addendum so that
derived type information is correctly set in the descriptor being
established.

This allows namelist IO with derived type to work correctly.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D113258

Files:
  flang/runtime/descriptor.cpp


Index: flang/runtime/descriptor.cpp
===================================================================
--- flang/runtime/descriptor.cpp
+++ flang/runtime/descriptor.cpp
@@ -241,6 +241,14 @@
     }
   }
   raw_.rank = newRank;
+  if (const auto *sourceAddendum = source.Addendum()) {
+    auto *addendum = Addendum();
+    if (addendum) {
+      *addendum = *sourceAddendum;
+    } else {
+      return false;
+    }
+  }
   return CFI_section(&raw_, &source.raw_, lower, upper, stride) == CFI_SUCCESS;
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D113258.385010.patch
Type: text/x-patch
Size: 508 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211105/b1071cc4/attachment.bin>


More information about the llvm-commits mailing list