From 16b63cdeff58dd22f321e655a01d1674ffa166e6 Mon Sep 17 00:00:00 2001 From: Tamas Vajk Date: Wed, 26 Jun 2024 11:37:07 +0200 Subject: [PATCH] Use dedicated API to get generated syntax trees --- .../extractor/Semmle.Extraction.CSharp/Extractor/Extractor.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/csharp/extractor/Semmle.Extraction.CSharp/Extractor/Extractor.cs b/csharp/extractor/Semmle.Extraction.CSharp/Extractor/Extractor.cs index d4c9f07f7447e..00225a3511c12 100644 --- a/csharp/extractor/Semmle.Extraction.CSharp/Extractor/Extractor.cs +++ b/csharp/extractor/Semmle.Extraction.CSharp/Extractor/Extractor.cs @@ -170,9 +170,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);