mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
Rust: Ensure singleton
This commit is contained in:
@@ -168,12 +168,12 @@ private module StepsInput implements Impl::Private::StepsInputSig {
|
||||
or
|
||||
exists(ArgumentPosition pos, Expr arg |
|
||||
s.head() = Impl::Private::SummaryComponent::parameter(pos) and
|
||||
arg = getSourceNodeArgument(source, s.tail().head()) and
|
||||
arg = getSourceNodeArgument(source, s.tail().headOfSingleton()) and
|
||||
result.asParameter() = getCallable(arg).getParam(pos.getPosition())
|
||||
)
|
||||
or
|
||||
result.(RustDataFlow::PostUpdateNode).getPreUpdateNode().asExpr().getExpr() =
|
||||
getSourceNodeArgument(source, s.head())
|
||||
getSourceNodeArgument(source, s.headOfSingleton())
|
||||
}
|
||||
|
||||
RustDataFlow::Node getSinkNode(Input::SinkBase sink, Impl::Private::SummaryComponent sc) {
|
||||
|
||||
@@ -709,6 +709,9 @@ module Make<
|
||||
this = TConsSummaryComponentStack(result, _)
|
||||
}
|
||||
|
||||
/** Gets the head of this stack if it is a singleton. */
|
||||
SummaryComponent headOfSingleton() { this = TSingletonSummaryComponentStack(result) }
|
||||
|
||||
/** Gets the tail of this stack, if any. */
|
||||
SummaryComponentStack tail() { this = TConsSummaryComponentStack(_, result) }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user