mirror of https://github.com/icsharpcode/ILSpy.git
Browse Source
For an async iterator with an [EnumeratorCancellation] cancellation token, the hoisted-local cleanup (stfld <>u__N(this, null)) can be emitted before the combined CancellationTokenSource disposal in the set-result and catch blocks. CheckSetResultReturnBlock and ValidateCatchBlock only consumed that cleanup after the disposal, so the `pos + 2 == count` test missed the dispose pattern and the analysis failed, leaving the raw state machine (catch (object), goto case, ...). Allow the cleanup to appear before the combined-tokens disposal as well. Assisted-by: Copilot:claude-opus-4.8:GitHub Copilot CLIpull/3831/head
2 changed files with 25 additions and 0 deletions
Loading…
Reference in new issue