Skip to content

Commit 87c7dd9

Browse files
committed
C#: Disregard destructors in model generation.
1 parent 0cf4e64 commit 87c7dd9

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

csharp/ql/src/utils/model-generator/internal/CaptureModelsSpecific.qll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ private predicate isRelevantForModels(CS::Callable api) {
3636
api.getDeclaringType().getNamespace().getQualifiedName() != "" and
3737
not api instanceof CS::ConversionOperator and
3838
not api instanceof Util::MainMethod and
39-
not isHigherOrder(api)
39+
not isHigherOrder(api) and
40+
not api instanceof CS::Destructor
4041
}
4142

4243
/**

csharp/ql/test/utils/model-generator/Summaries.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ namespace Summaries;
66

77
public class BasicFlow
88
{
9+
// No flow summary and no negative summary either.
10+
~BasicFlow() { }
11+
912
private string tainted;
1013

1114
public BasicFlow ReturnThis(object input)

0 commit comments

Comments
 (0)