Rename and document viableArgParamSpecific to make clear it is a temporary hook.

This commit is contained in:
Chris Smowton
2023-04-12 14:33:46 +01:00
parent 1706367b34
commit 7eefa43f5a
16 changed files with 35 additions and 23 deletions

View File

@@ -1618,7 +1618,9 @@ OutNode getAnOutNode(DataFlowCall call, ReturnKind kind) { call = result.getCall
/**
* Holds if flow from `call`'s argument `arg` to parameter `p` is permissible.
*
* This is a filter on top of the language-neutral argument/parameter matching implemented by `viableParamArg`.
* This is a temporary hook to support technical debt in the Go language; do not use.
*/
pragma[inline]
predicate viableParamArgSpecific(DataFlowCall call, ParameterNode p, ArgumentNode arg) { any() }
predicate golangSpecificParamArgFilter(DataFlowCall call, ParameterNode p, ArgumentNode arg) {
any()
}

View File

@@ -426,7 +426,7 @@ private module Cached {
viableParam(call, ppos, p) and
argumentPositionMatch(call, arg, ppos) and
compatibleTypes(getNodeDataFlowType(arg), getNodeDataFlowType(p)) and
viableParamArgSpecific(call, p, arg)
golangSpecificParamArgFilter(call, p, arg)
)
}