www.fgks.org   »   [go: up one dir, main page]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data flow: Improve pruning when calculating flow through #16182

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions shared/dataflow/codeql/dataflow/internal/DataFlowImpl.qll
Original file line number Diff line number Diff line change
Expand Up @@ -1493,10 +1493,10 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
}

private signature module FwdFlowInInputSig {
default predicate callRestriction(DataFlowCall call) { any() }

bindingset[p, apa]
default predicate parameterRestriction(ParamNodeEx p, ApApprox apa) { any() }
bindingset[call, p, apa]
default predicate callEdgeRestriction(DataFlowCall call, ParamNodeEx p, ApApprox apa) {
any()
}
}

/**
Expand All @@ -1518,8 +1518,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
boolean allowsFieldFlow, ApApprox apa
) {
PrevStage::callEdgeArgParam(call, c, arg, p, allowsFieldFlow, apa) and
I::callRestriction(call) and
I::parameterRestriction(p, apa)
I::callEdgeRestriction(call, p, apa)
}

pragma[nomagic]
Expand Down Expand Up @@ -1859,9 +1858,11 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
}

private module FwdFlowThroughRestriction implements FwdFlowInInputSig {
predicate callRestriction = PrevStage::callMayFlowThroughRev/1;

predicate parameterRestriction = PrevStage::parameterMayFlowThrough/2;
bindingset[call, p, apa]
predicate callEdgeRestriction(DataFlowCall call, ParamNodeEx p, ApApprox apa) {
PrevStage::parameterMayFlowThrough(p, pragma[only_bind_into](apa)) and
flowThroughOutOfCall(call, _, _, _, _, pragma[only_bind_into](apa), _)
}
}

/**
Expand Down
Loading