You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Protect imported source files from AST-only output aliases #901
bugA problem that causes incorrect behavior or crashes.help wantedThe issue requires extra attention or help from others.needs testingIssues that require additional testing or verification.
An AST-only build can overwrite an imported Wave source through an output symlink. Output validation protects the primary source, then returns before collecting imported inputs.
Reproduction
Audited on Linux amd64 at 53bb5809cf32d29f5a5a9d313ffa332ea3cd4beb, whose tracked tree matches canonical master c5ab63f9eec388c75b00f5cd59eae28a45a9b39f. Compiler built with Rust 1.89.0, LLVM 21, and the checkout std; Whale is locked to 020d2a4. Executed in a temporary directory:
Exit status is 0. helper.wave is replaced with AST JSON. The fixture was restored after the audit; no checkout source was used as the output.
Scope
src/cli.rsvalidate_output_paths returns early for a single AST emit after checking only classified inputs. The later imported-input collection never runs. Reuse the alias protections in src/output_guard.rs while preserving AST-only behavior and avoiding unnecessary backend compilation.
Related #745; this is the remaining AST-only imported-input gap. #851 separately concerns linker-script inputs.
Completion criteria
AST outputs cannot replace direct or transitively imported sources through direct, normalized, symlink, or hardlink aliases.
Rejection happens before any output write and leaves all inputs byte-identical.
Safe AST-only output still works for supported dump formats without requiring backend lowering.
bugA problem that causes incorrect behavior or crashes.help wantedThe issue requires extra attention or help from others.needs testingIssues that require additional testing or verification.
Activity
Protect compiler inputs and strengthen Whale lowering validation (#911)