aboutsummaryrefslogtreecommitdiff
path: root/src/mpack/mpack_core.c
Commit message (Collapse)AuthorAge
* fix(mpack): wrong encoding of integers beyond the int32 range #42085Suliman Abdulrazzaq2026-09-29
| | | | | | | | | | | | | | Problem: vim.mpack.encode() picks the msgpack size of a negative integer from its low 32 bits only, so -(2^32 + 5) is written as a negative fixint and decodes as -5. Numbers beyond +-2^53 trip an assertion in debug builds. In release builds, numbers below -2^63 or from 2^64 up go through out-of-range conversions: -1.5 * 2^63 decodes as 2^62. Solution: Use int64 whenever the high word is not a sign extension. Encode numbers outside [-2^63, 2^64), including NaN and infinities, as floats. AI-assisted
* fix(mpack): boundary values for negative integer encoding #37255benarcher26912026-03-21
| | | | | | | | | | | | | | | | | | Problem: libmpack encodes boundary values -129 and -32769 with wrong integer sizes: - -129 as int8 instead of int16 - -32769 as int16 instead of int32 because the boundary checks compare against the wrong values (e.g., lo < 0xffffff7f instead of lo < 0xffffff80). This caused data corruption: -129 would decode as 127. Solution: Fix off-by-one errors in the two's complement boundary constants: 0xffffff80 (-128, min int8) and 0xffff8000 (-32768, min int16). Fixes #37202 Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* build: remove PVSdundargoc2023-11-12
| | | | | | | We already have an extensive suite of static analysis tools we use, which causes a fair bit of redundancy as we get duplicate warnings. PVS is also prone to give false warnings which creates a lot of work to identify and disable.
* fix(rpc): don't parse msgpack if buflen is 0 (#21899)zeertzjq2023-01-19
| | | | This prevents `buflen` from becoming a very large number when it is 0 when calling mpack_rtoken().
* refactor(api): use a unpacker based on libmpack instead of msgpack-cbfredl2022-06-02
| | | | | | | | | | Currently this is more or less a straight off reimplementation, but this allow further optimizations down the line, especially for avoiding memory allocations of rpc objects. Current score for "make functionaltest; make oldtest" on a -DEXITFREE build: is 117 055 352 xfree(ptr != NULL) calls (that's NUMBERWANG!).
* ci(PVS): PVS/V009: add required header #15751dundargoc2021-09-21
|
* fix(ci): don't enrage the CI Gods by calling a file 'core.*'Björn Linse2021-09-09