Address review comments

This commit is contained in:
Tom Hvitved
2024-09-03 10:13:09 +02:00
parent 1057bb443f
commit 07fcd81e7e

View File

@@ -1722,11 +1722,6 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
if ap instanceof ApNil then emptyAp = true else emptyAp = false if ap instanceof ApNil then emptyAp = true else emptyAp = false
} }
bindingset[call, c, p, apa]
private signature predicate callRestrictionSig(
DataFlowCall call, DataFlowCallable c, ParamNodeEx p, ApApprox apa, boolean emptyAp
);
private signature predicate flowThroughSig(); private signature predicate flowThroughSig();
/** /**
@@ -1737,8 +1732,8 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
* need to record the argument that flows into the parameter. * need to record the argument that flows into the parameter.
* *
* For flow through, we do need to record the argument, however, we can restrict * For flow through, we do need to record the argument, however, we can restrict
* this to arguments that may actually flow through, using `flowThroughSig`, * this to arguments that may actually flow through, which reduces the
* which reduces the argument-to-parameter fan-in significantly. * argument-to-parameter fan-in significantly.
*/ */
private module FwdFlowIn<flowThroughSig/0 flowThrough> { private module FwdFlowIn<flowThroughSig/0 flowThrough> {
pragma[nomagic] pragma[nomagic]
@@ -1747,14 +1742,14 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
ApApprox apa ApApprox apa
) { ) {
exists(boolean allowsFieldFlow | exists(boolean allowsFieldFlow |
PrevStage::callEdgeArgParam(call, c, arg, p, allowsFieldFlow, apa) and PrevStage::callEdgeArgParam(call, c, arg, p, allowsFieldFlow, apa)
if emptyAp = true then apa instanceof PrevStage::ApNil else any()
| |
if if
PrevStage::callMayFlowThroughRev(call) and PrevStage::callMayFlowThroughRev(call) and
PrevStage::parameterMayFlowThrough(p, apa) PrevStage::parameterMayFlowThrough(p, apa)
then then
emptyAp = true and emptyAp = true and
apa instanceof PrevStage::ApNil and
flowThrough() flowThrough()
or or
emptyAp = false and emptyAp = false and
@@ -1763,7 +1758,8 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
else ( else (
not flowThrough() and not flowThrough() and
( (
emptyAp = true emptyAp = true and
apa instanceof PrevStage::ApNil
or or
emptyAp = false and emptyAp = false and
allowsFieldFlow = true allowsFieldFlow = true