[flang-commits] [flang] a9309e4 - [flang][runtime] Fix seg fault in intrinsic execute_command_line (#78126)
via flang-commits
flang-commits at lists.llvm.org
Mon Jan 15 02:45:53 PST 2024
Author: SiHuaN
Date: 2024-01-15T18:45:48+08:00
New Revision: a9309e4a168a7f7c1313cc1b488d988cc3b0a8d4
URL: https://github.com/llvm/llvm-project/commit/a9309e4a168a7f7c1313cc1b488d988cc3b0a8d4
DIFF: https://github.com/llvm/llvm-project/commit/a9309e4a168a7f7c1313cc1b488d988cc3b0a8d4.diff
LOG: [flang][runtime] Fix seg fault in intrinsic execute_command_line (#78126)
Fixes #77975
Added:
Modified:
flang/runtime/execute.cpp
Removed:
################################################################################
diff --git a/flang/runtime/execute.cpp b/flang/runtime/execute.cpp
index c327f07f5cbffe..eedb2d322e44d4 100644
--- a/flang/runtime/execute.cpp
+++ b/flang/runtime/execute.cpp
@@ -70,8 +70,8 @@ int TerminationCheck(int status, const Descriptor *cmdstat,
if (!cmdstat) {
terminator.Crash("Execution error with system status code: %d", status);
} else {
- CheckAndStoreIntToDescriptor(cmdstat, EXECL_ERR, terminator);
- CopyCharsToDescriptor(*cmdmsg, "Execution error");
+ StoreIntToDescriptor(cmdstat, EXECL_ERR, terminator);
+ CheckAndCopyCharsToDescriptor(cmdmsg, "Execution error");
}
}
#ifdef _WIN32
@@ -86,8 +86,8 @@ int TerminationCheck(int status, const Descriptor *cmdstat,
terminator.Crash(
"Invalid command quit with exit status code: %d", exitStatusVal);
} else {
- CheckAndStoreIntToDescriptor(cmdstat, INVALID_CL_ERR, terminator);
- CopyCharsToDescriptor(*cmdmsg, "Invalid command line");
+ StoreIntToDescriptor(cmdstat, INVALID_CL_ERR, terminator);
+ CheckAndCopyCharsToDescriptor(cmdmsg, "Invalid command line");
}
}
#if defined(WIFSIGNALED) && defined(WTERMSIG)
@@ -95,8 +95,8 @@ int TerminationCheck(int status, const Descriptor *cmdstat,
if (!cmdstat) {
terminator.Crash("killed by signal: %d", WTERMSIG(status));
} else {
- CheckAndStoreIntToDescriptor(cmdstat, SIGNAL_ERR, terminator);
- CopyCharsToDescriptor(*cmdmsg, "killed by signal");
+ StoreIntToDescriptor(cmdstat, SIGNAL_ERR, terminator);
+ CheckAndCopyCharsToDescriptor(cmdmsg, "killed by signal");
}
}
#endif
@@ -105,8 +105,8 @@ int TerminationCheck(int status, const Descriptor *cmdstat,
if (!cmdstat) {
terminator.Crash("stopped by signal: %d", WSTOPSIG(status));
} else {
- CheckAndStoreIntToDescriptor(cmdstat, SIGNAL_ERR, terminator);
- CopyCharsToDescriptor(*cmdmsg, "stopped by signal");
+ StoreIntToDescriptor(cmdstat, SIGNAL_ERR, terminator);
+ CheckAndCopyCharsToDescriptor(cmdmsg, "stopped by signal");
}
}
#endif
More information about the flang-commits
mailing list