Skip to content

Commit 33e3410

Browse files
committed
temp
1 parent 8037643 commit 33e3410

File tree

2 files changed

+16
-51
lines changed

2 files changed

+16
-51
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
failures
21
testFailures
2+
failures

shared/dataflow/codeql/dataflow/internal/DataFlowImpl.qll

Lines changed: 15 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1428,26 +1428,18 @@ module MakeImpl<InputSig Lang> {
14281428
)
14291429
or
14301430
// flow into a callable
1431-
exists(Typ t0, TypOption origT0, boolean inSummaryCtx |
1432-
fwdFlowIn(node, apa, state, cc, t0, origT0, ap, inSummaryCtx)
1431+
exists(boolean inSummaryCtx |
1432+
fwdFlowIn(node, apa, state, cc, t, origT, ap, inSummaryCtx)
14331433
|
14341434
PrevStage::parameterMayFlowThrough(node, apa) and
14351435
summaryCtx = TParamNodeSome(node.asNode()) and
14361436
argT = ArgTypOption::some(toArgTyp(t)) and
1437-
argAp = apSome(ap) and
1438-
// t = getNodeTyp(node) and
1439-
// if origT0.isNone() then origT.asSome() = t0 else origT = origT0
1440-
t = t0 and
1441-
origT = origT0
1437+
argAp = apSome(ap)
14421438
or
1443-
// t = t0 and
1444-
// origT = origT0
14451439
Param::nodeMayFlowNotThrough(node, apa) and
14461440
summaryCtx = TParamNodeNone() and
14471441
argT instanceof ArgTypOption::None and
14481442
argAp = apNone() and
1449-
t = t0 and
1450-
origT = origT0 and
14511443
inSummaryCtx = false
14521444
)
14531445
or
@@ -1459,12 +1451,12 @@ module MakeImpl<InputSig Lang> {
14591451
or
14601452
// flow through a callable
14611453
exists(
1462-
DataFlowCall call, CcCall ccc, ReturnKindExt kind, boolean allowsFieldFlow,
1454+
DataFlowCall call, CcCall ccc, RetNodeEx ret, boolean allowsFieldFlow,
14631455
ApApprox innerArgApa
14641456
|
1465-
fwdFlowThrough(call, cc, state, ccc, summaryCtx, argT, argAp, t, origT, ap, apa, kind,
1457+
fwdFlowThrough(call, cc, state, ccc, summaryCtx, argT, argAp, t, origT, ap, apa, ret,
14661458
innerArgApa) and
1467-
flowThroughOutOfCall(call, ccc, kind, node, allowsFieldFlow, innerArgApa, apa) and
1459+
flowThroughOutOfCall(call, ccc, ret, _, node, allowsFieldFlow, innerArgApa, apa) and
14681460
if allowsFieldFlow = false then ap instanceof ApNil else any()
14691461
)
14701462
}
@@ -1944,30 +1936,14 @@ module MakeImpl<InputSig Lang> {
19441936
RetNodeEx ret, FlowState state, CcCall ccc, ParamNodeEx summaryCtx, ArgTyp argT, Ap argAp,
19451937
ApApprox argApa, Typ t, TypOption origT, Ap ap, ApApprox apa
19461938
) {
1947-
exists(ReturnKindExt kind |
1939+
exists(DataFlowCall call, ReturnKindExt kind, boolean allowsFieldFlow |
19481940
fwdFlow(pragma[only_bind_into](ret), state, ccc,
19491941
TParamNodeSome(pragma[only_bind_into](summaryCtx.asNode())), ArgTypOption::some(argT),
19501942
pragma[only_bind_into](apSome(argAp)), t, origT, ap, pragma[only_bind_into](apa)) and
1951-
kind = ret.getKind() and
19521943
parameterFlowThroughAllowed(summaryCtx, kind) and
19531944
argApa = getApprox(argAp) and
1954-
PrevStage::returnMayFlowThrough(ret, argApa, apa, kind)
1955-
)
1956-
}
1957-
1958-
pragma[nomagic]
1959-
private predicate fwdFlowRetFromArg1(
1960-
ReturnKindExt kind, FlowState state, CcCall ccc, ParamNodeEx summaryCtx, ArgTyp argT,
1961-
Ap argAp, ApApprox argApa, Typ t, TypOption origT, Ap ap, ApApprox apa
1962-
) {
1963-
exists(RetNodeEx ret |
1964-
fwdFlow(pragma[only_bind_into](ret), state, ccc,
1965-
TParamNodeSome(pragma[only_bind_into](summaryCtx.asNode())), ArgTypOption::some(argT),
1966-
pragma[only_bind_into](apSome(argAp)), t, origT, ap, pragma[only_bind_into](apa)) and
1967-
kind = ret.getKind() and
1968-
parameterFlowThroughAllowed(summaryCtx, kind) and
1969-
argApa = getApprox(argAp) and
1970-
PrevStage::returnMayFlowThrough(ret, argApa, apa, kind)
1945+
flowThroughOutOfCall(call, ccc, ret, kind, _, allowsFieldFlow, argApa, apa) and
1946+
if allowsFieldFlow = false then ap instanceof ApNil else any()
19711947
)
19721948
}
19731949

@@ -1984,26 +1960,13 @@ module MakeImpl<InputSig Lang> {
19841960
innerArgAp)
19851961
}
19861962

1987-
pragma[inline]
1988-
private predicate fwdFlowThrough1(
1989-
DataFlowCall call, Cc cc, FlowState state, CcCall ccc, ParamNodeOption summaryCtx,
1990-
ArgTypOption argT, ApOption argAp, Typ t, TypOption origT, Ap ap, ApApprox apa,
1991-
ReturnKindExt kind, ParamNodeEx innerSummaryCtx, ArgTyp innerArgT, Ap innerArgAp,
1992-
ApApprox innerArgApa
1993-
) {
1994-
fwdFlowRetFromArg1(kind, state, ccc, innerSummaryCtx, innerArgT, innerArgAp, innerArgApa,
1995-
t, origT, ap, apa) and
1996-
fwdFlowIsEntered(call, cc, ccc, summaryCtx, argT, argAp, innerSummaryCtx, innerArgT,
1997-
innerArgAp)
1998-
}
1999-
20001963
pragma[nomagic]
20011964
private predicate fwdFlowThrough(
20021965
DataFlowCall call, Cc cc, FlowState state, CcCall ccc, ParamNodeOption summaryCtx,
20031966
ArgTypOption argT, ApOption argAp, Typ t, TypOption origT, Ap ap, ApApprox apa,
2004-
ReturnKindExt kind, ApApprox innerArgApa
1967+
RetNodeEx ret, ApApprox innerArgApa
20051968
) {
2006-
fwdFlowThrough1(call, cc, state, ccc, summaryCtx, argT, argAp, t, origT, ap, apa, kind, _,
1969+
fwdFlowThrough0(call, cc, state, ccc, summaryCtx, argT, argAp, t, origT, ap, apa, ret, _,
20071970
_, _, innerArgApa)
20081971
}
20091972

@@ -2022,8 +1985,10 @@ module MakeImpl<InputSig Lang> {
20221985
DataFlowCall call, Cc cc, CcCall innerCc, ParamNodeOption summaryCtx, ArgTypOption argT,
20231986
ApOption argAp, ParamNodeEx p, ArgTyp t, Ap ap
20241987
) {
2025-
FwdFlowIn<FwdFlowThroughRestriction>::fwdFlowIn(call, _, p, _, cc, innerCc, summaryCtx,
2026-
argT, argAp, any(Typ t0 | t = toArgTyp(t0)), _, ap, _, _)
1988+
exists(ApApprox apa |
1989+
FwdFlowIn<FwdFlowThroughRestriction>::fwdFlowIn(call, _, p, _, cc, innerCc, summaryCtx,
1990+
argT, argAp, any(Typ t0 | t = toArgTyp(t0)), _, ap, apa, _)
1991+
)
20271992
}
20281993

20291994
pragma[nomagic]

0 commit comments

Comments
 (0)