blaise/runtime
Graeme Geldenhuys 13a8a39af0 fix(compiler): incremental unit-mode crash (nil Prog.SymbolTable)
Compiling a UNIT (top source is a `unit`, so the pipeline runs in unit-mode and
Prog stays nil) via the default incremental path segfaulted: the incremental
worker setup unconditionally read `Prog.SymbolTable` to seed each dep worker,
dereferencing nil.  In unit-mode the symbol table comes from the semantic pass,
not a program node.  This is exactly the invocation the runtime Makefile drives
(`blaise --source X.pas --output X.o` per RTL unit), so it broke `make` in
runtime/ once incremental became the default; it was a latent pre-existing bug
in the opt-in incremental path (reproduces at de0ea5d with --incremental).

Fix: seed the worker symbol table from Semantic.GetSymbolTable() when Prog is
nil, matching the non-incremental unit-mode path.

Also pin the runtime Makefile to --no-incremental.  That Makefile is itself a
hand-managed separate-compilation system (one object per unit + an explicit
archive list); the compiler's incremental mode would additionally write
per-dependency side-effect objects and skip inlining a used unit's bodies, but
those side-effect objects are not in the archive list — so a cross-unit symbol
(e.g. typeinfo_TRtlPlatform, referenced by the derived TRtlPlatformPosix in a
different unit) was left undefined at link.  Whole-program per unit keeps each
unit object self-contained.

Regression test (cp.test.e2e.sepcompile.pas): compile a unit that uses another
unit in unit-mode via the default incremental path, then build and run a
program over the emitted object.
2026-06-20 02:04:58 +01:00
..
src feat(string): writable string subscript S[i] := ch with copy-on-write 2026-06-18 15:39:38 +01:00
Makefile fix(compiler): incremental unit-mode crash (nil Prog.SymbolTable) 2026-06-20 02:04:58 +01:00
project.xml refactor: split rtl/ into runtime/ + stdlib/, rename bcl.testing to blaise.testing 2026-05-16 00:51:18 +01:00