[flang-commits] [flang] [flang] fix VLA using malloc and avoid using std::vector, arg input type change to char * from std::byte (PR #77911)

Peter Klausler via flang-commits flang-commits at lists.llvm.org
Fri Jan 12 08:53:08 PST 2024


================
@@ -108,17 +108,19 @@ void FORTRAN_PROCEDURE_NAME(getlog)(std::byte *arg, std::int64_t length) {
   if (nameMaxLen == -1)
     nameMaxLen = _POSIX_LOGIN_NAME_MAX + 1;
 #endif
-  std::vector<char> str(nameMaxLen);
+  Terminator terminator{__FILE__, __LINE__};
+  char *str{(char *)AllocateMemoryOrCrash(terminator, nameMaxLen)};
----------------
klausler wrote:

Use C++ casting, not C.

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


More information about the flang-commits mailing list