Commit 1a9df91
authored
Fix dataflow analysis of lambdas in async methods (#122450)
When we enter ILLinker part of the ILC codebase, we need to switch to
the mode where async variants don't exist and async methods have
mismatched bodies. There was a spot where we didn't do the switch here:
https://github.com/dotnet/runtime/blob/d31e5990b896447bfc3dbe98cfe6ec3b169a4896/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/UsageBasedMetadataManager.cs#L939-L949
The fix is to do the switch early in `FlowAnnotations` so that the
`ILProvider` `FlowAnnotations` use (and other parts take advantage of)
is already ILLinkerified.
Fixes the situation shown in the regression test (we were analyzing the
IL of the async variant of `RuntimeAsyncWithLambda` and missed analyzing
the lambda completely).1 parent 512c425 commit 1a9df91
File tree
3 files changed
+17
-2
lines changed- src
- coreclr/tools/aot/ILCompiler.Compiler/Compiler/Dataflow
- tools/illink/test/Mono.Linker.Tests.Cases/DataFlow
3 files changed
+17
-2
lines changedLines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
| 40 | + | |
39 | 41 | | |
40 | 42 | | |
41 | 43 | | |
| |||
299 | 301 | | |
300 | 302 | | |
301 | 303 | | |
302 | | - | |
| 304 | + | |
303 | 305 | | |
304 | 306 | | |
305 | 307 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| |||
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| 30 | + | |
29 | 31 | | |
30 | 32 | | |
31 | 33 | | |
| |||
103 | 105 | | |
104 | 106 | | |
105 | 107 | | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
106 | 119 | | |
107 | 120 | | |
0 commit comments