You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Integer literals above i64::MAX crash the compiler #165
Any integer literal larger than i64::MAX panics the compiler, including a valid u64 constant:
const X: u64 = 18446744073709551615
thread 'main' panicked at core/src/schema/idl/grammar.rs:1063:75:
called `Result::unwrap()` on an `Err` value: ParseIntError { kind: PosOverflow }
IntegerLiteral parses -?\d+ into an i64 with s.parse().unwrap(). The same panic happens for a fixed array size (u8[99999999999999999999]) or any other literal.
Fix: parse into a type wide enough for every integer type (i128, or keep the digits as text), and report a literal no type can hold as a diagnostic, not a panic. u64::MAX must stay writable.
Also in the language server and the playground. Both run this parser on what's typed. In the playground (core 5259393, built to wasm), such a literal makes compile, generate (Rust and TypeScript), the simulator's describe_project, hover and completion all fail with RuntimeError: unreachable and a "wasm error" status, until the literal is edited away; only highlighting keeps working. The module recovers afterwards. Typing a u64 constant near its maximum is enough to hit it.
Fixed by fd780b4: a literal above i64::MAX is now a parse::integer-out-of-range diagnostic at the literal, not a panic. Since #215, the ids_parse fuzz target checks this nightly.
Activity
Kinflou commentedon Nov 9, 2026
Fixed by fd780b4: a literal above i64::MAX is now a
parse::integer-out-of-rangediagnostic at the literal, not a panic. Since #215, theids_parsefuzz target checks this nightly.