Skip to content

Commit 561b097

Browse files
Fix using DependencyGraphViewer with AOT compilers (dotnet#76357)
The `readonly` addition was one of the 3600 diffs in dotnet#74825. `MarkStrategy` can have mutable state that was getting lost because Roslyn considers it valid to put `_marker` into a temporary before calling instance methods on it. This resulted in DependencyGraphViewer hanging after seeing tens of thousands of new graphs being added.
1 parent 48468d1 commit 561b097

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/coreclr/tools/aot/ILCompiler.DependencyAnalysisFramework/DependencyAnalyzer.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ namespace ILCompiler.DependencyAnalysisFramework
2525
public sealed class DependencyAnalyzer<MarkStrategy, DependencyContextType> : DependencyAnalyzerBase<DependencyContextType> where MarkStrategy : struct, IDependencyAnalysisMarkStrategy<DependencyContextType>
2626
{
2727
#pragma warning disable SA1129 // Do not use default value type constructor
28-
private readonly MarkStrategy _marker = new MarkStrategy();
28+
private MarkStrategy _marker = new MarkStrategy();
2929
#pragma warning restore SA1129 // Do not use default value type constructor
3030
private DependencyContextType _dependencyContext;
3131
private IComparer<DependencyNodeCore<DependencyContextType>> _resultSorter;

0 commit comments

Comments
 (0)