mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
DataFlow: Support a bare Argument[n] as a valid output stack
This commit is contained in:
@@ -565,8 +565,7 @@ module Make<
|
||||
isLocalSummaryComponent(s.head())
|
||||
}
|
||||
|
||||
/** Like `isSupportedInputStack` but for output stacks. */
|
||||
private predicate isSupportedOutputStack(SummaryComponentStack s) {
|
||||
private predicate isSupportedOutputStack1(SummaryComponentStack s) {
|
||||
// ReturnValue.*
|
||||
s.length() = 1 and
|
||||
s.head() instanceof TReturnSummaryComponent
|
||||
@@ -581,10 +580,19 @@ module Make<
|
||||
s.head() instanceof TParameterSummaryComponent and
|
||||
s.tail().head() instanceof TArgumentSummaryComponent
|
||||
or
|
||||
isSupportedOutputStack(s.tail()) and
|
||||
isSupportedOutputStack1(s.tail()) and
|
||||
isLocalSummaryComponent(s.head())
|
||||
}
|
||||
|
||||
/** Like `isSupportedInputStack` but for output stacks. */
|
||||
private predicate isSupportedOutputStack(SummaryComponentStack s) {
|
||||
isSupportedOutputStack1(s)
|
||||
or
|
||||
// `Argument[n]` not followed by anything. Needs to be outside the recursion.
|
||||
s.length() = 1 and
|
||||
s.head() instanceof TArgumentSummaryComponent
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if `callable` has an unsupported flow `input -> output`.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user