[flang-commits] [flang] [flang] add SYSTEM runtime and lowering intrinsics support (PR #74309)

Yi Wu via flang-commits flang-commits at lists.llvm.org
Fri Dec 29 05:23:01 PST 2023


================
@@ -173,5 +173,17 @@ 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)) {
----------------
yi-wu-arm wrote:

done, used `std::memchr(str, '\0', length)` instead

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


More information about the flang-commits mailing list