mirror of
https://github.com/github/codeql.git
synced 2025-12-21 03:06:31 +01:00
C#: Remove default clears content.
This commit is contained in:
@@ -139,28 +139,6 @@ private class RecordConstructorFlow extends SummarizedCallable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private class SummarizedCallableDefaultClearsContent extends Impl::Public::SummarizedCallable {
|
|
||||||
SummarizedCallableDefaultClearsContent() {
|
|
||||||
this instanceof Impl::Public::SummarizedCallable or none()
|
|
||||||
}
|
|
||||||
|
|
||||||
// By default, we assume that all stores into arguments are definite
|
|
||||||
override predicate clearsContent(ParameterPosition pos, DataFlow::ContentSet content) {
|
|
||||||
exists(SummaryComponentStack output, SummaryComponent target |
|
|
||||||
this.propagatesFlow(_, output, _) and
|
|
||||||
output.drop(_) =
|
|
||||||
SummaryComponentStack::push(SummaryComponent::content(content),
|
|
||||||
SummaryComponentStack::singleton(target)) and
|
|
||||||
not content instanceof DataFlow::ElementContent
|
|
||||||
|
|
|
||||||
target = SummaryComponent::argument(pos.getPosition())
|
|
||||||
or
|
|
||||||
target = SummaryComponent::qualifier() and
|
|
||||||
pos.isThisParameter()
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class RequiredSummaryComponentStack = Impl::Public::RequiredSummaryComponentStack;
|
class RequiredSummaryComponentStack = Impl::Public::RequiredSummaryComponentStack;
|
||||||
|
|
||||||
private class RecordConstructorFlowRequiredSummaryComponentStack extends RequiredSummaryComponentStack {
|
private class RecordConstructorFlowRequiredSummaryComponentStack extends RequiredSummaryComponentStack {
|
||||||
|
|||||||
@@ -933,7 +933,8 @@ module Private {
|
|||||||
summaryElement(this, inSpec, outSpec, kind, false)
|
summaryElement(this, inSpec, outSpec, kind, false)
|
||||||
or
|
or
|
||||||
summaryElement(this, inSpec, outSpec, kind, true) and
|
summaryElement(this, inSpec, outSpec, kind, true) and
|
||||||
not summaryElement(this, _, _, _, false)
|
not summaryElement(this, _, _, _, false) and
|
||||||
|
not this.clearsContent(_, _)
|
||||||
}
|
}
|
||||||
|
|
||||||
override predicate propagatesFlow(
|
override predicate propagatesFlow(
|
||||||
|
|||||||
@@ -933,7 +933,8 @@ module Private {
|
|||||||
summaryElement(this, inSpec, outSpec, kind, false)
|
summaryElement(this, inSpec, outSpec, kind, false)
|
||||||
or
|
or
|
||||||
summaryElement(this, inSpec, outSpec, kind, true) and
|
summaryElement(this, inSpec, outSpec, kind, true) and
|
||||||
not summaryElement(this, _, _, _, false)
|
not summaryElement(this, _, _, _, false) and
|
||||||
|
not this.clearsContent(_, _)
|
||||||
}
|
}
|
||||||
|
|
||||||
override predicate propagatesFlow(
|
override predicate propagatesFlow(
|
||||||
|
|||||||
@@ -933,7 +933,8 @@ module Private {
|
|||||||
summaryElement(this, inSpec, outSpec, kind, false)
|
summaryElement(this, inSpec, outSpec, kind, false)
|
||||||
or
|
or
|
||||||
summaryElement(this, inSpec, outSpec, kind, true) and
|
summaryElement(this, inSpec, outSpec, kind, true) and
|
||||||
not summaryElement(this, _, _, _, false)
|
not summaryElement(this, _, _, _, false) and
|
||||||
|
not this.clearsContent(_, _)
|
||||||
}
|
}
|
||||||
|
|
||||||
override predicate propagatesFlow(
|
override predicate propagatesFlow(
|
||||||
|
|||||||
Reference in New Issue
Block a user