[flang-commits] [flang] [flang] Fixed write past allocated descriptor in PointerAssociateRemapping. (PR #127000)

Eugene Epshteyn via flang-commits flang-commits at lists.llvm.org
Wed Feb 12 19:41:16 PST 2025


================
@@ -89,14 +89,18 @@ void RTDEF(PointerAssociateLowerBounds)(Descriptor &pointer,
 void RTDEF(PointerAssociateRemapping)(Descriptor &pointer,
     const Descriptor &target, const Descriptor &bounds, const char *sourceFile,
     int sourceLine) {
-  pointer = target;
-  pointer.raw().attribute = CFI_attribute_pointer;
   Terminator terminator{sourceFile, sourceLine};
   SubscriptValue byteStride{/*captured from first dimension*/};
   std::size_t boundElementBytes{bounds.ElementBytes()};
   std::size_t boundsRank{
       static_cast<std::size_t>(bounds.GetDimension(1).Extent())};
-  pointer.raw().rank = boundsRank;
+  // We cannot just assign target into pointer descriptor, because
----------------
eugeneepshteyn wrote:

+1

https://github.com/llvm/llvm-project/pull/127000


More information about the flang-commits mailing list