The ProcessClosureBody method within ProcessMethodBodies is called from a LINQ query that iterates over a list of possible candidates. It starts with MarkVisited(node);, but neglects to put a WasVisited guard before that, which means that the code below it that calls CodeBuilder.CreateMethod and then CurrentMethod.DeclaringType.Members.Add(closure); can run multiple times for the same closure.
The ProcessClosureBody method within ProcessMethodBodies is called from a LINQ query that iterates over a list of possible candidates. It starts with
MarkVisited(node);
, but neglects to put aWasVisited
guard before that, which means that the code below it that callsCodeBuilder.CreateMethod
and thenCurrentMethod.DeclaringType.Members.Add(closure);
can run multiple times for the same closure.