diff --git a/csharp/extractor/Semmle.Extraction.CSharp/Extractor/Extractor.cs b/csharp/extractor/Semmle.Extraction.CSharp/Extractor/Extractor.cs index e968ef239422..7bf2b08985a9 100644 --- a/csharp/extractor/Semmle.Extraction.CSharp/Extractor/Extractor.cs +++ b/csharp/extractor/Semmle.Extraction.CSharp/Extractor/Extractor.cs @@ -169,9 +169,7 @@ static bool filter(CompilerCall compilerCall) } var args = reader.ReadCommandLineArguments(compilerCall); - - // Generated syntax trees are always added to the end of the list of syntax trees. - var generatedSyntaxTrees = compilation.SyntaxTrees.Skip(compilationData.Compilation.SyntaxTrees.Count()); + var generatedSyntaxTrees = compilationData.GetGeneratedSyntaxTrees(); using var analyser = new BinaryLogAnalyser(new LogProgressMonitor(logger), logger, pathTransformer, canonicalPathCache, options.AssemblySensitiveTrap);