[flang-commits] [flang] [flang][runtime] zero size allocation in source allocation (PR #66124)

via flang-commits flang-commits at lists.llvm.org
Wed Sep 13 03:48:28 PDT 2023


jeanPerier wrote:

> Be advised, the C/C++ standards leave the behavior of `malloc` implementation-defined in the case of a zero-sized allocation, and they are allowed to return a null pointer or to return a non-null pointer that is not distinct from other zero-sized allocations. Consider allocating at least a single byte.

Thanks, I updated Descriptor::Allocate runtime to do that since it is the core place called by all sorts of allocations that may be zero sized in Fortran.

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


More information about the flang-commits mailing list