diff --git a/shared/dataflow/codeql/dataflow/internal/DataFlowImplCommon.qll b/shared/dataflow/codeql/dataflow/internal/DataFlowImplCommon.qll index b2d4d13b07d..962a58c26f9 100644 --- a/shared/dataflow/codeql/dataflow/internal/DataFlowImplCommon.qll +++ b/shared/dataflow/codeql/dataflow/internal/DataFlowImplCommon.qll @@ -2115,11 +2115,13 @@ module MakeImplCommon Lang> { * context. */ private predicate typeFlowParamType(ParamNode p, Type t, boolean cc) { - exists(Callable c | - Input::dataFlowNonCallEntry(c, cc) and - if cc = true and exists(getSourceContextParameterNodeType(p)) - then t = getSourceContextParameterNodeType(p) - else trackedParamWithType(p, t, c) + exists(Callable c | Input::dataFlowNonCallEntry(c, cc) | + cc = true and + nodeEnclosingCallable(p, c) and + t = getSourceContextParameterNodeType(p) + or + (cc = false or not exists(getSourceContextParameterNodeType(p))) and + trackedParamWithType(p, t, c) ) or exists(Type t1, Type t2 |