Skip to content

fix: bind globals before projecting access paths - #298

Merged
swananan merged 1 commit into
mainfrom
fix/bind-globals-before-projection
Sep 6, 2026
Merged

swananan merged 1 commit into
mainfrom
fix/bind-globals-before-projection

Conversation

@swananan

@swananan swananan commented Sep 6, 2026

Copy link
Copy Markdown
Owner

Two compilation units can each define a static cfg. Previously, cfg.other could select the other unit's object merely because it had the requested field. Bind the declaration before lowering or projecting the access path, and keep an invalid field access as an error.

PC-aware global fallback now retains each indexed static's lexical owner and checks it against the active function, lexical blocks, and inline origins before preferring the current compilation unit. An unrelated function's static state = 999 no longer hides the external state = 11 used by the traced function. Addressless anonymous scopes emitted by Clang remain candidates for ambiguity checking; their compilation unit alone cannot make them win. Existing global discovery and context-free queries still include static locals.

Validation:

  • Real ELF regression tests cover cross-unit binding, inaccessible function/block statics, and GCC/Clang optimized inline statics, including unknown-scope collisions.
  • Runtime regressions verify both scalar and field bindings, valid static locals in their own function, and rejection outside their scope.
  • cargo fmt --all, full workspace Clippy with warnings and undocumented unsafe blocks denied, and 955 non-e2e unit/integration/doc tests passed.
  • Full standard e2e passed: 345 tests, including 49 Rust script tests and all four static-scope runtime cases (runner 8b0914225ff3).
  • Independent sub-agent review found no remaining blocking issue.
  • All 10 GitHub checks passed on commit da7727f, including standard e2e, all three full container topologies, host-PID container smoke, and the DWARF performance regression check. Remote logs confirm the three ELF regression tests and four static-scope runtime cases actually executed.

Based directly on current main, including the merged main-module identity recovery fix.

@swananan
swananan marked this pull request as ready for review September 6, 2026 04:59
@swananan
swananan force-pushed the fix/explicit-main-module branch from cd9803a to 6e2a165 Compare September 6, 2026 06:11
Base automatically changed from fix/explicit-main-module to main September 6, 2026 07:01
@swananan
swananan force-pushed the fix/bind-globals-before-projection branch from 28e9c89 to da7727f Compare September 6, 2026 07:46
@swananan
swananan merged commit 262442c into main Sep 6, 2026
10 checks passed
@swananan
swananan deleted the fix/bind-globals-before-projection branch September 6, 2026 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant