From ecce30ed5a3e771e6363ba977da2c1f1a63ef4cc Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Tue, 23 Aug 2022 14:13:24 +0200 Subject: [PATCH] C#: Remove clearsContent predicate from the framework code. --- .../dataflow/internal/FlowSummaryImpl.qll | 29 +------------------ 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/csharp/ql/lib/semmle/code/csharp/dataflow/internal/FlowSummaryImpl.qll b/csharp/ql/lib/semmle/code/csharp/dataflow/internal/FlowSummaryImpl.qll index e00fc952e1c..d857cdaa359 100644 --- a/csharp/ql/lib/semmle/code/csharp/dataflow/internal/FlowSummaryImpl.qll +++ b/csharp/ql/lib/semmle/code/csharp/dataflow/internal/FlowSummaryImpl.qll @@ -226,15 +226,6 @@ module Public { none() } - /** - * Holds if values stored inside `content` are cleared on objects passed as - * arguments at position `pos` to this callable. - * - * TODO: Remove once all languages support `WithoutContent` tokens. - */ - pragma[nomagic] - predicate clearsContent(ParameterPosition pos, ContentSet content) { none() } - /** * Holds if the summary is auto generated. */ @@ -328,23 +319,6 @@ module Private { SummaryComponentStack::singleton(TArgumentSummaryComponent(_))) and preservesValue = preservesValue1.booleanAnd(preservesValue2) ) - or - exists(ParameterPosition ppos, ContentSet cs | - c.clearsContent(ppos, cs) and - input = SummaryComponentStack::push(SummaryComponent::withoutContent(cs), output) and - output = SummaryComponentStack::argument(ppos) and - preservesValue = true - ) - } - - private class MkClearStack extends RequiredSummaryComponentStack { - override predicate required(SummaryComponent head, SummaryComponentStack tail) { - exists(SummarizedCallable sc, ParameterPosition ppos, ContentSet cs | - sc.clearsContent(ppos, cs) and - head = SummaryComponent::withoutContent(cs) and - tail = SummaryComponentStack::argument(ppos) - ) - } } /** @@ -945,8 +919,7 @@ module Private { AccessPath inSpec, AccessPath outSpec, string kind ) { summaryElement(this, inSpec, outSpec, kind, true) and - not summaryElement(this, _, _, _, false) and - not this.clearsContent(_, _) + not summaryElement(this, _, _, _, false) } private predicate relevantSummaryElement(AccessPath inSpec, AccessPath outSpec, string kind) {