mirror of
https://github.com/github/codeql.git
synced 2025-12-22 03:36:30 +01:00
Add dataflow callback to filter out receiver argument flow to Golang interface dispatch candidates.
Other langauges stub the callback.
This commit is contained in:
@@ -1614,3 +1614,11 @@ private module OutNodes {
|
||||
* `kind`.
|
||||
*/
|
||||
OutNode getAnOutNode(DataFlowCall call, ReturnKind kind) { call = result.getCall(kind) }
|
||||
|
||||
/**
|
||||
* 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`.
|
||||
*/
|
||||
pragma[inline]
|
||||
predicate viableParamArgSpecific(DataFlowCall call, ParameterNode p, ArgumentNode arg) { any() }
|
||||
|
||||
@@ -425,7 +425,8 @@ private module Cached {
|
||||
exists(ParameterPosition ppos |
|
||||
viableParam(call, ppos, p) and
|
||||
argumentPositionMatch(call, arg, ppos) and
|
||||
compatibleTypes(getNodeDataFlowType(arg), getNodeDataFlowType(p))
|
||||
compatibleTypes(getNodeDataFlowType(arg), getNodeDataFlowType(p)) and
|
||||
viableParamArgSpecific(call, p, arg)
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user