Skip to content

Commit 3c2336e

Browse files
authored
Merge pull request github#15074 from hvitved/dataflow/get-node-type-cached
Data flow: Use cached `nodeDataFlowType` instead of `getNodeType`
2 parents a39eb5e + b3929e2 commit 3c2336e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

shared/dataflow/codeql/dataflow/internal/DataFlowImplCommon.qll

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1123,8 +1123,8 @@ module MakeImplCommon<InputSig Lang> {
11231123
Input::enableTypeFlow() and
11241124
(
11251125
exists(ParamNode p, DataFlowType at, DataFlowType pt |
1126-
at = getNodeType(arg) and
1127-
pt = getNodeType(p) and
1126+
nodeDataFlowType(arg, at) and
1127+
nodeDataFlowType(p, pt) and
11281128
relevantCallEdge(_, _, arg, p) and
11291129
typeStrongerThan0(pt, at)
11301130
)
@@ -1133,8 +1133,8 @@ module MakeImplCommon<InputSig Lang> {
11331133
// A call edge may implicitly strengthen a type by ensuring that a
11341134
// specific argument node was reached if the type of that argument was
11351135
// strengthened via a cast.
1136-
at = getNodeType(arg) and
1137-
pt = getNodeType(p) and
1136+
nodeDataFlowType(arg, at) and
1137+
nodeDataFlowType(p, pt) and
11381138
paramMustFlow(p, arg) and
11391139
relevantCallEdge(_, _, arg, _) and
11401140
typeStrongerThan0(at, pt)
@@ -1174,8 +1174,8 @@ module MakeImplCommon<InputSig Lang> {
11741174
or
11751175
exists(ArgNode arg, DataFlowType at, DataFlowType pt |
11761176
trackedParamTypeCand(p) and
1177-
at = getNodeType(arg) and
1178-
pt = getNodeType(p) and
1177+
nodeDataFlowType(arg, at) and
1178+
nodeDataFlowType(p, pt) and
11791179
relevantCallEdge(_, _, arg, p) and
11801180
typeStrongerThan0(at, pt)
11811181
)

0 commit comments

Comments
 (0)