mirror of
https://github.com/github/codeql.git
synced 2026-04-29 02:35:15 +02:00
Merge pull request #19147 from aschackmull/ssa/writedef-source-refactor
Ssa: Refactor data flow integration to make the input signature simpler
This commit is contained in:
@@ -506,7 +506,7 @@ module SsaFlow {
|
||||
result.(Impl::ExprPostUpdateNode).getExpr() =
|
||||
n.(PostUpdateNode).getPreUpdateNode().(ExprNode).getControlFlowNode()
|
||||
or
|
||||
result.(Impl::ParameterNode).getParameter() = n.(ExplicitParameterNode).getSsaDefinition()
|
||||
result.(Impl::WriteDefSourceNode).getDefinition() = n.(ExplicitParameterNode).getSsaDefinition()
|
||||
}
|
||||
|
||||
predicate localFlowStep(Ssa::SourceVariable v, Node nodeFrom, Node nodeTo, boolean isUseStep) {
|
||||
|
||||
@@ -1023,16 +1023,12 @@ private module DataFlowIntegrationInput implements Impl::DataFlowIntegrationInpu
|
||||
|
||||
Expr getARead(Definition def) { exists(getAReadAtNode(def, result)) }
|
||||
|
||||
predicate ssaDefAssigns(WriteDefinition def, Expr value) {
|
||||
predicate ssaDefHasSource(WriteDefinition def) {
|
||||
// exclude flow directly from RHS to SSA definition, as we instead want to
|
||||
// go from RHS to matching assingnable definition, and from there to SSA definition
|
||||
none()
|
||||
// go from RHS to matching assignable definition, and from there to SSA definition
|
||||
def instanceof Ssa::ImplicitParameterDefinition
|
||||
}
|
||||
|
||||
class Parameter = Ssa::ImplicitParameterDefinition;
|
||||
|
||||
predicate ssaDefInitializesParam(WriteDefinition def, Parameter p) { def = p }
|
||||
|
||||
/**
|
||||
* Allows for flow into uncertain defintions that are not call definitions,
|
||||
* as we, conservatively, consider such definitions to be certain.
|
||||
|
||||
Reference in New Issue
Block a user