DataFlow: Support a bare Argument[n] as a valid output stack

This commit is contained in:
Asger F
2025-05-12 09:42:45 +02:00
parent 8fab235d66
commit 891b2b8335

View File

@@ -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`.
*