Download Latest Version v1.17.0 source code.zip (686.7 kB)
Email in envelope

Get an email when there's a new version of Cpp-Peglib

Home / v1.15.1
Name Modified Size InfoDownloads / Week
Parent folder
README.md 2026-07-29 990 Bytes
v1.15.1 source code.tar.gz 2026-07-29 613.4 kB
v1.15.1 source code.zip 2026-07-29 673.9 kB
Totals: 3 Items   1.3 MB 3

Bug Fixes

  • Fix undefined 32-bit shift in packrat mix() on wasm32 (4b3bd64): The packrat cache's hash function performed h >> 32 on a size_t-typed value. On wasm32, where size_t is 32 bits, this shift is undefined behavior — clang -O2 detected it and collapsed the packrat lookup into unreachable, causing a trap at parse time. Fixed by mixing in uint64_t and narrowing at the end (bit-identical to the previous behavior on 64-bit targets).

  • Serialize grammar definitions in name order (73a37a3): GrammarBlob::serialize walked Grammar (a std::unordered_map) in its raw iteration order, which is implementation-defined — the same grammar could produce different byte sequences under different standard libraries, making a checked-in blob non-byte-comparable across platforms. Fixed by emitting definitions sorted by name (deserialize() rebuilds the map from names, so nothing depends on the order).

Both fixes include new tests in test_serialize.cc.

Source: README.md, updated 2026-07-29