Skip to content

serialize 2.1.5: tighten UTF-8 decode bounds checks and fix MSVC 19.52 /O2 emulated uint128 multiply

Choose a tag to compare

@gafferongames gafferongames released this 20 Nov 18:53
· 6 commits to main since this release
42945bd

Format 2.0. No byte a writer emits changed, and STANDARD.md and conformance/ are unchanged since 2.1.4.

  • serialize_uint128_t::operator* (serialize.h): Compute result.lo = lo * other.lo directly instead of reassembling product_ll + (product_lh << 32) + (product_hl << 32), which Visual Studio 18 2026 (MSVC 19.52.37029.0 /O2) miscompiled by dropping product_lh << 32 when one factor is a power of two and the other spans both 32-bit halves (pinned in test_uint128_emulation).
  • serialize_utf.h (#181): serialize_utf8_decode returns 0 immediately on a null input pointer or non-positive input_bytes without dereferencing input[0], and serialize_utf16_to_utf8, serialize_utf32_to_utf8, serialize_utf8_to_utf16, and serialize_utf8_to_utf32 refuse a null input pointer when the input length is positive, NUL-terminating output through serialize_utf_refuse.
  • COMPATIBILITY & IMPLEMENTING.md: Records serialize.c at v2.1.2 and clarifies that the destination width rule (U16) and its bit-field exception apply to C++.

Full diff: v2.1.4...v2.1.5