fluffos/testsuite/single/tests/operators
Claude d23d24172f change: mask shift counts mod 64 instead of erroring
'<<'/'>>' with a shift count that's negative or >= 64 is UB for LPC's
64-bit int. Previously fixed by rejecting the count with a clean
error(); switched instead to masking the count to its low 6 bits
(`& 63`) before shifting, matching Java's `long` shift semantics (JLS
15.19). This keeps every LPC int a legal shift count with a
deterministic result (e.g. `1 << 100` == `1 << 36`) rather than making
an otherwise-ordinary script error out for shifting by a large or
negative amount.

Applied consistently across all three parallel sites so a folded and
unfolded shift by the same count always agree: the runtime efuns
(f_lsh/f_rsh/f_lsh_eq/f_rsh_eq, ops.cc), the compile-time constant
folder (trees.cc's binary_int_op()), and the #if preprocessor
evaluator (lexer_rules_pp.cc's ifexpr_binop()).

Updated shift_overflow.lpc to assert the masked values instead of a
caught error, and AGENTS.md's audit-checklist entry to describe masking
rather than guard-and-error for shifts specifically (the INT_MIN/-1
divide/modulo guards are unchanged).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YTPLudxra3u1andNyWJEQG
2026-07-14 13:37:57 -05:00
..
buffer_bytes.lpc vm: string foreach/ref fixes, buffers as byte arrays (foreach, strict bytes, to_buffer), thorough ref tests; #1196 docs follow-up (#1250) 2026-07-12 01:39:30 -04:00
buffer_range_assign.lpc vm: string foreach/ref fixes, buffers as byte arrays (foreach, strict bytes, to_buffer), thorough ref tests; #1196 docs follow-up (#1250) 2026-07-12 01:39:30 -04:00
class.lpc Prefer .lpc source extension; rename testsuite to .lpc 2026-07-09 20:48:48 -04:00
compound_assign_float.lpc Keep float variables float across compound assignment (#993) 2026-07-11 14:56:46 -04:00
compound_assign_undefined.lpc fix: ops.cc compound-assign efuns don't clear the lvalue's subtype 2026-07-14 13:37:57 -05:00
foreach.lpc vm: string foreach/ref fixes, buffers as byte arrays (foreach, strict bytes, to_buffer), thorough ref tests; #1196 docs follow-up (#1250) 2026-07-12 01:39:30 -04:00
mapping.lpc Prefer .lpc source extension; rename testsuite to .lpc 2026-07-09 20:48:48 -04:00
range.lpc Prefer .lpc source extension; rename testsuite to .lpc 2026-07-09 20:48:48 -04:00
ref.lpc vm: string foreach/ref fixes, buffers as byte arrays (foreach, strict bytes, to_buffer), thorough ref tests; #1196 docs follow-up (#1250) 2026-07-12 01:39:30 -04:00
shift_overflow.lpc change: mask shift counts mod 64 instead of erroring 2026-07-14 13:37:57 -05:00
string_char_incdec_value.lpc fix: string-char lvalue reentrancy and missing/broken inc-dec write-back 2026-07-14 13:37:57 -05:00
string_char_lvalue_ref_reentrancy.lpc fix: string-char lvalue reentrancy and missing/broken inc-dec write-back 2026-07-14 13:37:57 -05:00
string_index.lpc vm: string foreach/ref fixes, buffers as byte arrays (foreach, strict bytes, to_buffer), thorough ref tests; #1196 docs follow-up (#1250) 2026-07-12 01:39:30 -04:00
switch.lpc Prefer .lpc source extension; rename testsuite to .lpc 2026-07-09 20:48:48 -04:00
too_deep_recursion.lpc Prefer .lpc source extension; rename testsuite to .lpc 2026-07-09 20:48:48 -04:00