Skip to content

Fix #1638: identify renamed yield state machine members via method impls - #3905

Merged
siegfriedpammer merged 1 commit into
masterfrom
issue1638
Jul 22, 2026
Merged

Fix #1638: identify renamed yield state machine members via method impls#3905
siegfriedpammer merged 1 commit into
masterfrom
issue1638

Conversation

@siegfriedpammer

Copy link
Copy Markdown
Member

Fix #1638

Obfuscators may rename the members of compiler-generated iterator classes while keeping the MethodImpl (.override) rows intact. Since b110d5c (first shipped in ILSpy 8.0), Dispose, get_Current and GetEnumerator are identified by name or method impl; MoveNext was the last remaining name-only lookup, so such a state machine was rejected with "Method not found". The new ILPretty fixture models the obfuscated shape from the issue's assemblies, against which the fix was verified; the rest of the issue was already resolved by b110d5c and 81e702f.

Assisted-by: Claude:claude-fable-5:Claude Code

Obfuscators may rename the members of compiler-generated iterator
classes while keeping the MethodImpl (.override) rows intact. Since
b110d5c (first shipped in ILSpy 8.0), Dispose, get_Current and
GetEnumerator are identified by name or method impl; MoveNext was still
looked up by name only, so such a state machine was rejected with
"Method not found". The pre-Roslyn "yield break" handling likewise
matched the Dispose call by name; it now compares against the already
resolved Dispose handle. The new ILPretty fixture models the obfuscated
shape from the issue's assemblies, against which the fix was verified;
the rest of the issue was already resolved by b110d5c and 81e702f.

Assisted-by: Claude:claude-fable-5:Claude Code
@siegfriedpammer
siegfriedpammer merged commit cac1209 into master Jul 22, 2026
13 checks passed
@siegfriedpammer
siegfriedpammer deleted the issue1638 branch July 22, 2026 19:36
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.

Yield return FSM problem (FSM not identified)

1 participant