Skip to content

pointers: compose nested yields renames - #315

Merged
gnidan merged 1 commit into
mainfrom
pointers-nested-yields
Oct 3, 2026
Merged

gnidan merged 1 commit into
mainfrom
pointers-nested-yields

Conversation

@gnidan

@gnidan gnidan commented Oct 3, 2026

Copy link
Copy Markdown
Member

When template references nest, dereference renamed each yielded region using only the innermost yields mapping, so the enclosing references' renames were dropped. The spec says a reference's yields maps the names its template produces, and an inner reference's renamed output is what the outer template produces, so renames should compose.

This hit solc's ethdebug output (argotorg/solidity#16990): for mapping(address => mapping(uint => Profile)) where Profile has a string name, the string's data region came back as name-data instead of value-name-data.

generateRegions now applies every mapping on the rename stack, innermost first, each renaming the previous result. Names saved for later references already composed, because each template's pop-region-renames runs in turn from the inside out and aliases the previous result, so that path is unchanged. Behavior without nesting is unchanged. A regression test covers a two-level case, and the changelog has an entry.

@github-actions

github-actions Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-10-03 02:20 UTC

@gnidan
gnidan merged commit 97e53c1 into main Oct 3, 2026
7 checks passed
@gnidan
gnidan deleted the pointers-nested-yields branch October 3, 2026 02:16
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