[flang-commits] [flang] [Flang] malloc(1) on AIX as malloc(0) returns nullptr (PR #73878)

via flang-commits flang-commits at lists.llvm.org
Thu Nov 30 08:31:20 PST 2023


================
@@ -75,7 +75,14 @@ RT_API_ATTRS int CFI_allocate(CFI_cdesc_t *descriptor,
     dim->sm = byteSize;
     byteSize *= extent;
   }
+#ifdef _AIX
----------------
jeanPerier wrote:

+1, and I think you should do that regardless of the platform since std::malloc(0) is undefined.

This is also done like that for the allocations from Fortran since: https://github.com/llvm/llvm-project/pull/66124

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


More information about the flang-commits mailing list