Skip to content

helpers: key distinct type aliases by their own identity (fixes upstream#41564) - #42

Open
Moonbot-Tech wants to merge 1 commit into
unleashedpascal:mainfrom
Moonbot-Tech:fix-41564
Open

helpers: key distinct type aliases by their own identity (fixes upstream#41564)#42
Moonbot-Tech wants to merge 1 commit into
unleashedpascal:mainfrom
Moonbot-Tech:fix-41564

Conversation

@Moonbot-Tech

Copy link
Copy Markdown

Problem. FPC issue #41564: the helper key for a record or object was built from the base structure's symbol table, so several distinct aliases of one record (type TA = type TB) shared a single key and lookup returned the helper registered last for any of them.

Fix. In generate_objectpascal_helper_key a df_unique def now keys by its own owner and name; plain aliases keep the structural key. Your helper-key refactor on main already routes both registration and lookup through this function, so the change is two lines.

Test. tests/webtbs/tw41564.pp: wrong helper picked on current main, correct after the fix.

Validation. Win64 build of main (a359fc1) with the patch; 405 neighbouring tests from tests/test (inline, rtti, helpers, generics, opt) give identical results before and after.

🤖 Generated with Claude Code

…eam#41564)

The helper key for a record or object was built from the base
structure's symbol table, so several distinct aliases of one record
(type TA = type TB) shared a single key and lookup returned the helper
registered last for any of them.

For a df_unique def build the key from the def's own owner and name;
plain aliases keep sharing the structural key.

FPC issue: https://gitlab.com/freepascal.org/fpc/source/-/issues/41564

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@fibodevy fibodevy added the waiting-upstream Stock FPC fix, waits for the upstream MR to be merged or rejected label Sep 6, 2026
@Moonbot-Tech

Copy link
Copy Markdown
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

waiting-upstream Stock FPC fix, waits for the upstream MR to be merged or rejected

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants