Skip to content

Commit e6f4263

Browse files
committed
C#: Do not print compiler generated statements.
1 parent bf4e3a7 commit e6f4263

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

csharp/ql/lib/semmle/code/csharp/PrintAst.qll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ class PrintAstConfiguration extends TPrintAstConfiguration {
2727
}
2828

2929
private predicate shouldPrint(Element e, Location l) {
30-
exists(PrintAstConfiguration config | config.shouldPrint(e, l))
30+
exists(PrintAstConfiguration config | config.shouldPrint(e, l)) and
31+
not e.(Stmt).isCompilerGenerated()
3132
}
3233

3334
private predicate isImplicitExpression(ControlFlowElement element) {

0 commit comments

Comments
 (0)