Skip to content

Fix #4349: avoid folding user delegate initialization - #4354

Open
siegfriedpammer wants to merge 1 commit into
masterfrom
4349-overmatched-delegate-cache
Open

siegfriedpammer wants to merge 1 commit into
masterfrom
4349-overmatched-delegate-cache

Conversation

@siegfriedpammer

Copy link
Copy Markdown
Member

Fixes #4349.

Delegate-cache folding was matching a user-authored lazy delegate initialization and dropping its field access and null check. Require compiler-generated metadata on the cache field or its containing type before applying the VB cache patterns. Add a C# regression fixture and exercise VB delegate caches across the compiler matrix.

Validation:

  • dotnet test --project ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj --no-build --filter "FullyQualifiedName~PrettyTestRunner.Issue4349" --report-trx (18 passed)
  • dotnet test --project ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj --no-build --filter "FullyQualifiedName~VBPrettyTestRunner.VBDelegateCache" --report-trx (20 passed)

User fields with a null-checked delegate assignment are ordinary lazy initialization, not compiler caches. Require generated-field metadata before folding the VB cache patterns, while retaining coverage of the C# regression and VB compiler cache shapes.

Assisted-by: OpenCode:gpt-6-luna:OpenCode

This branch has not been deployed

No deployments
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.

Misdecompilation of a lazy initialization pattern

1 participant