Skip to content

Fix renaming bug triggered by static locals hiding other locals/formals.#229

Open
difcsi wants to merge 1 commit into
goblint:developfrom
difcsi:fix-renaming-bug
Open

Fix renaming bug triggered by static locals hiding other locals/formals.#229
difcsi wants to merge 1 commit into
goblint:developfrom
difcsi:fix-renaming-bug

Conversation

@difcsi

@difcsi difcsi commented May 13, 2026

Copy link
Copy Markdown

Hi everyone,

I'm Zoltán, working with Stephen (#228) on some CIL-related things. Besides the architectural changes, we have some bug fixes that we are keen to contribute to your efforts.

When a static local is promoted to a global, the alpha renaming usually remembers any suffix added and chooses a fresh suffix for later vars of the same name. However, if the same function also has a (non-static) local with the same name, this gets clobbered: the alpha renamer throws away the renaming state after the function scope is done. This can be triggered if (among other cases) two functions in the same file both have like-named statics hiding other locals/formals (seen in Motif).

When a static local is promoted to a global, the alpha renaming usually
remembers any suffix added and chooses a fresh suffix for later vars of
the same name. However, if the same function also has a (non-static)
local with the same name, this gets clobbered: the alpha renamer throws
away the renaming state after the function scope is done. This can be
triggered if (among other cases) two functions in the same file both
have like-named statics hiding other locals/formals (seen in Motif).

Co-authored-by: Stephen Kell <srk31@srcf.ucam.org>
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