Skip to content

← All updates

session

Soundness passes: escape analysis, sound security annotations, verified constant-time

Between sessions 27 and 30 the compiler stopped trusting its own good intentions and started proving things: about user code and about itself.

References can no longer dangle

  • Second-class references (src/escape.rs, compiler/escape.fd): a &T / &mut T can no longer be stored in a struct, returned from a function’s locals, sent to a task, or captured by an escaping closure. The escape check runs in both compilers, so a reference that would outlive its referent is a compile error everywhere, not just on one backend.
  • Vec<f64> reads and f64 returns fixed on all three backends on the way, and the fixpoint was re-verified after the change.

Security annotations made sound

  • @tainted became real data-flow tracking: taint propagates through expressions until a sanitizer clears it or it hits a sink (SQL, shell, HTML, path), which is a compile error.
  • @zeroize now wipes heap data too, not just stack slots: PE output verified byte-for-byte on the affected tests.
  • Post-codegen constant-time verification: after the peephole stage, verify_constant_time_asm scans the final x86-64 assembly of a @constant_time function for conditional/indirect jumps, memory cmov, indexed memory ops, variable-latency ops, and calls into non-CT functions. Violations are build errors: the check inspects what the CPU will actually run, not what the IR hoped for. (ELF path today; PE/ARM64/RISC-V coverage is planned.)
  • cast_arg ABI repair in both C codegens heals &mut Vec → Vec forwards, and cl.exe linking was fixed on Windows (cmd /C quote-stripping).

Branch consolidation

release-infra merged into main; 92 &mut call sites removed; str_equal replaced by plain ==; the bootstrap fixpoint re-verified byte-for-byte afterward.