From 9ea798dba422e9ea46170f6316eb09e45fcd1b02 Mon Sep 17 00:00:00 2001 From: Andrew Noyes Date: Sun, 14 Jun 2026 19:42:41 -0400 Subject: [PATCH] Fix aarch64 multi-byte UTF-8 parsing and add symbol imports file On aarch64, char is unsigned by default, so *buf < 0x20 never held for bytes >= 0x80, causing strDfa.scan to be skipped for multi-byte UTF-8 sequences in batch mode. Cast to int8_t to get the same signed comparison used by the SIMD path. Also add aarch64-symbol-imports.txt with the GLIBC 2.17 versioned symbols imported by the library on that platform. --- aarch64-symbol-imports.txt | 3 +++ src/parser3.h | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 aarch64-symbol-imports.txt diff --git a/aarch64-symbol-imports.txt b/aarch64-symbol-imports.txt new file mode 100644 index 0000000..4b54ba1 --- /dev/null +++ b/aarch64-symbol-imports.txt @@ -0,0 +1,3 @@ +free@GLIBC_2.17 +malloc@GLIBC_2.17 +memmove@GLIBC_2.17 diff --git a/src/parser3.h b/src/parser3.h index 4f7e9d8..6a233eb 100644 --- a/src/parser3.h +++ b/src/parser3.h @@ -218,7 +218,7 @@ inline PRESERVE_NONE WeaselJsonStatus scan_string_impl(Parser3 *self, .count_leading_nonzero_lanes(); buf += normal; if (normal < V::lanes) { - if (buf != bufEnd && *buf < 0x20) { + if (buf != bufEnd && (int8_t)*buf < 0x20) { buf = (char *)self->strDfa.scan(buf, bufEnd); } break;