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
Decimal u64 literals >= 2^63 pass check but lose bit 63 at runtime #68
with check /tmp/with_u64_max_literal.w # ok
with run /tmp/with_u64_max_literal.w # panics: assertion failed
Why this matters
This breaks any code that relies on exact high-bit u64 values, including bit masks, exact word assembly, and literal-driven constant paths.
In Crux this surfaced while reconstructing 64-bit constants from exact bit patterns: a value intended to be 0xf0f0f0f0f0f0f0f0 behaved like 0x70f0f0f0f0f0f0f0, which drops the top bit and changes popcount from 32 to 31.
Expected behavior
Both programs should run successfully. u64 literals that fit in range must preserve their exact runtime value, including bit 63.
Spec references
docs/with-specification.md says:
Primitive unsigned integer types include u64 at lines 688-689.
Integer literal suffixes include u64 at lines 724-727.
Suffixed literals are explicit and part of the literal token at lines 739-743.
A suffixed literal must fit in its declared type at lines 775-776.
These literals do fit in u64, so they should evaluate to their exact declared value at runtime.
Activity
Fix #68: lossless u64/u128 integer literals