[flang-commits] [flang] [flang][runtime] Fix seg fault in intrinsic execute_command_line (PR #78126)

via flang-commits flang-commits at lists.llvm.org
Sun Jan 14 23:53:49 PST 2024


https://github.com/sihuan created https://github.com/llvm/llvm-project/pull/78126

Fixes #77975 

>From bffb8b021e1e895df07ab5b7ce75a74ee84de206 Mon Sep 17 00:00:00 2001
From: SiHuaN <liyongtai at iscas.ac.cn>
Date: Mon, 15 Jan 2024 07:50:20 +0000
Subject: [PATCH] [flang][runtime] Fix seg fault in intrinsic
 execute_command_line

---
 flang/runtime/execute.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/flang/runtime/execute.cpp b/flang/runtime/execute.cpp
index c327f07f5cbffe..7368f2f576519c 100644
--- a/flang/runtime/execute.cpp
+++ b/flang/runtime/execute.cpp
@@ -87,7 +87,7 @@ int TerminationCheck(int status, const Descriptor *cmdstat,
           "Invalid command quit with exit status code: %d", exitStatusVal);
     } else {
       CheckAndStoreIntToDescriptor(cmdstat, INVALID_CL_ERR, terminator);
-      CopyCharsToDescriptor(*cmdmsg, "Invalid command line");
+      CheckAndCopyCharsToDescriptor(cmdmsg, "Invalid command line");
     }
   }
 #if defined(WIFSIGNALED) && defined(WTERMSIG)



More information about the flang-commits mailing list