summary_session-2026-10-23.md 2.3 KB

Session 2026-10-23 — range checks + PACKEDSET

Branch master. Continues summary_session-2026-10-22.md from the 2026-10-22 stop point (v3-smallfix).

Numbers

gate start end
suite (compiler/run_tests.sh) 259/259 263/263
fixpoint (bootstrap/fixpoint.sh) OK (4,028,447 B) OK (4,075,853 B)
corpus (tools/v3-corpus/corpus.sh) 511/612 511/612, 0 crashes

What landed

PACKEDSET — SymTab + QbeGen + Lower + grammar

ISO PACKEDSET OF <ordinal> is implemented for spans up to 32 bits: 1/2/4-byte storage (SIZE is the packed width), ORD is the mask, and INCL/EXCL/IN, assignment, set operations, packed array/record elements and value/VAR parameters all work. Wider spans are a loud 230 implementation limit. Regression t_packedset.

The corpus files onebyte, onebyte2, onebyte3 still do not compile, but the blocker is earlier: they use the module variable r inside assert before its declaration (declaration order, rejected by policy). With r moved before the procedure they compile and run correctly. Corpus stays 511.

Runtime subrange range checks — Lower + QbeGen.CheckRange

V3 accepted base-typed values into CHAR/enum subranges but emitted no runtime check. Lower.CheckSub now traps (abort) when the value is outside the destination subrange on:

  • assignment (scalar, field or array element);
  • a value actual whose formal is a subrange;
  • RETURN whose function result is a subrange;
  • INC/DEC on a subrange.

The post-increment of a FOR control variable is exempt: the final successor of a loop over a full subrange (FOR x := 0 TO 3 with x: [0..3]) may legitimately exceed the upper bound. LONGINT subranges are not checked yet.

Regressions: t_trap_range (assignment), t_trap_range_arg (actual), t_trap_range_ret (RETURN); t_subrange remains the in-range case.

Commits

commit tag work
54d84b9 v3-rangechecks runtime subrange range checks (+3 trap tests)
6b2df4c v3-packedset PACKEDSET 1/2/4-byte storage

Remaining

See docs/handoff-2026-10-23-next.md. The next candidates are ISO exceptions (dedicated session), multi-dimensional open arrays (ABI decision), and the library-folder / separate-compilation plans (both deferred).