[flang-commits] [flang] [llvm] [clang] [clang-tools-extra] [flang] Add EXECUTE_COMMAND_LINE runtime and lowering intrinsics implementation (PR #74077)

Peter Klausler via flang-commits flang-commits at lists.llvm.org
Thu Jan 4 08:38:59 PST 2024


================
@@ -173,5 +173,72 @@ RT_API_ATTRS void ShallowCopy(const Descriptor &to, const Descriptor &from) {
   ShallowCopy(to, from, to.IsContiguous(), from.IsContiguous());
 }
 
+RT_API_ATTRS const char *EnsureNullTerminated(
+    const char *str, std::size_t length, Terminator &terminator) {
+  const void *nullTerminatorPos{std::memchr(str, '\0', length)};
+
+  if (nullTerminatorPos == nullptr) {
----------------
klausler wrote:

`if (std::memchr(str, '\0', length) == nullptr) {`

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


More information about the flang-commits mailing list