mirror of
https://github.com/brazilofmux/tinymux
synced 2026-08-13 00:23:11 -04:00
#1866's proven-integral fast path upgrades tonumber(arg) to CALL_INT when the argument is an all-digit SCONST. But Lua 5.4 returns a FLOAT, not an integer, when a decimal literal overflows int64: tonumber("9223372036854775808") -> 9.2e18 (INT64_MAX + 1) tonumber("99999999999999999999999999") -> 1e26 For those, CALL_INT sees lua_isinteger == false and post-entry declines loud (#-1 LUA ERROR) where the interpreter answers the float — a compiled-vs-interpreter divergence, exactly the class the seam corpus guards, newly introduced by the fast path. lua_tonumber_arg_is_integral now bounds the significant-digit count: INT64_MAX has 19 digits, so <= 18 significant digits always fits and is guaranteed integral; 19+ falls back to CALL_VAL, which preserves the typed float. Conservative (some in-range 19-digit values take the slower CALL_VAL path) but sound — same significant-digit bound as the CIDR prefix guard. tonumber("17") still executes native. tests/luajit gains two EXEC pins (INT64_MAX+1 and a 26-digit literal); both FAIL against the pre-fix engine (post-entry decline) and pass after. Harness: 228 chunks, 0 divergences, 0 exec_post_entry. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| .gitignore | ||
| bench.sh | ||
| run.sh | ||