Repository navigation
Morrow v2.4.18 — Pointer Semantics, Sized Integers, and a Standalone Toolchain
Morrow v2.4.18 — Pointer Semantics, Sized Integers, and a Standalone Toolchain
Release date: 2026-11-09
Toolchain: forge 2.4.18 (morrow standalone 2026)
Self-hosting fixed point: D9FF387175979C534040AB5ED9AAAB9696C95FDEA096393678D2E994F877CDFE
(stage2.ll == stage3.ll, stage2.exe == stage3.exe, 536,064 bytes)
This release closes the three remaining Critical/High findings from
docs/AUDIT-2026-11-08.md that were blocking normal
systems programming: pointer/reference semantics, sized integers, and
location-independent toolchain paths.
Pointer, reference, and cast semantics (C-03 / issue #3)
parse_typeretains*mut T,*const T,&T, and&mut Tin the interned type.- Scalar
&lvaluelowers to real storage; struct/String/pointer bindings keep the
by-reference pointer value used by the compiler's calling convention. *mut Structfield stores use correct offsets;*mut u8/i8indexing uses byte
stride, andu16/u32indexing uses 2/4-byte strides.- Casts are type-directed: width truncation plus sign/zero extension; pointer casts
are i64 identity. - Address-of a non-lvalue is diagnosed.
ffi_demo.exenow exits 0 (prints40and100instead of access-violating).
Sized integer semantics (issue #10)
i8/i16/i32/i64/u8/u16/u32/u64now carry width and signedness through type checking.- Arithmetic and storage wrap modulo
2^width; assignments, fields, and index stores
normalize to the destination width. - Signed loads/casts sign-extend; unsigned loads/casts zero-extend;
i8array reads
of-1now produce-1. - Signed vs unsigned division/remainder and comparisons are distinguished, including
u64high-bit comparisons. - Integer literals outside
i64are rejected instead of silently wrapping.
Examples: let v: u8 = 250 + 10 → 4; 300 as u8 → 44; i8 load of 0xFF → -1;
u64 0-1 > 1 → true.
Standalone, location-independent toolchain (issue #12)
std/,compiler/, andlib/crtresolve from the executable's installation root
viaGetModuleFileNameA, not the caller's working directory.- Windows link lines use absolute
lib/crtpaths. forge newscaffolds a buildablefn main() -> i64 { 0 }project.- Unsupported
--targettriples are rejected before writing files or running clang.
Verified by building from an unrelated directory, scaffolding/building a project in
place, and checking --target bogus fails.
Bootstrap and correctness fixes found during self-hosting
- Optimizer handler-balance check now uses the real
TirFunction.argsblock list. - Generic pointer arguments normalize to the bare container identity (
Vec<*mut T>
behaves asVec<T>for shallow generics), and generic type symbols retain their
closing>. asbinds looser than unary&, so&mut counter as *mut Tmeans
(&mut counter) as *mut T.
Verification
| Gate | Result |
|---|---|
| Native suites | 23 positive |
| Compile-fail suites | 18 |
| Examples | 22/22 build |
| CWD/scaffold/target tests | pass |
| Bootstrap | stage2/stage3 IR and executable byte-identical |
| Distribution | Morrow-v2.4.18-win64.zip, forge.exe, mwc.exe, SHA256SUMS.txt |
New regression coverage in tests/syntax_features_test.mw: pointer storage, field
offsets, byte/word indexing, casts, integer arithmetic/storage/loads, u64
comparisons, CWD-independent builds, forge new, and unsupported-target rejection.
Compatibility
Source-compatible with v2.4.17. Programs that relied on unsized integer behavior
(260 in a u8, zero-extended i8 loads, pointer-as-value &scalar) now follow
their declared types. Struct fields still occupy 8-byte slots with normalized
values, and u64 is carried in the i64 register representation.