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

Peter Klausler via flang-commits flang-commits at lists.llvm.org
Wed Dec 27 09:22:00 PST 2023


================
@@ -173,5 +173,70 @@ 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, size_t length, Terminator &terminator) {
+  if (length <= std::strlen(str)) {
----------------
klausler wrote:

Do not call `std::strlen()` on a string that is not known to be NUL terminated.  Use `std::memchr` instead.

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


More information about the flang-commits mailing list