[libc-commits] [libc] [libc] Add UTF-16 support in CharacterConverter [1/6] (PR #230434)

via libc-commits libc-commits at lists.llvm.org
Tue Oct 13 17:57:55 PDT 2026


================
@@ -112,13 +161,31 @@ LIBC_INLINE int CharacterConverter::push(char8_t utf8_byte) {
     state->bytes_stored++;
     return 0;
   }
+  // Pushing when partially popping is a misuse in the library
+  if (isPartiallyPopping()) {
+    clear();
+    return -1;
+  }
----------------
yangbowen wrote:

Should I remove or modify the respective tests about misuse cases, so that these checks can be made into a `LIBC_ASSERT`?

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


More information about the libc-commits mailing list