Skip to content

fix: carry DWARF module origin in read plans#180

Merged
swananan merged 1 commit into
mainfrom
fix/dwarf-plan-module-origin
May 16, 2026
Merged

fix: carry DWARF module origin in read plans#180
swananan merged 1 commit into
mainfrom
fix/dwarf-plan-module-origin

Conversation

@swananan
Copy link
Copy Markdown
Owner

Global variable planning returned the resolved module path, but the compiler stored it in mutable context state and consumed it later during lowering. DWARF queries used only for type checks could leave stale hints behind, so later ASLR rebasing could use the wrong module for cross-module globals.

Store the module origin directly on read and materialization plans instead. Populate it in PC and global analyzers, and make compiler lowering use that explicit origin when converting link-time addresses to runtime addresses. Carry the same origin through dynamic array and member lowering so type completion for unknown aggregate targets is scoped to the module that owns the base variable.

Add a globals e2e regression with conflicting same-name struct layouts in the main executable and shared library. The test exercises dynamic member access through a shared-library global pointer and catches fallback to the current probe module.

Global variable planning returned the resolved module path, but the compiler
stored it in mutable context state and consumed it later during lowering. DWARF
queries used only for type checks could leave stale hints behind, so later ASLR
rebasing could use the wrong module for cross-module globals.

Store the module origin directly on read and materialization plans instead.
Populate it in PC and global analyzers, and make compiler lowering use that
explicit origin when converting link-time addresses to runtime addresses.
Carry the same origin through dynamic array and member lowering so type
completion for unknown aggregate targets is scoped to the module that owns the
base variable.

Add a globals e2e regression with conflicting same-name struct layouts in the
main executable and shared library. The test exercises dynamic member access
through a shared-library global pointer and catches fallback to the current
probe module.
@swananan swananan merged commit 85f7f95 into main May 16, 2026
10 checks passed
@swananan swananan deleted the fix/dwarf-plan-module-origin branch May 16, 2026 01:18
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