mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
C#: Switch from ssaDefAssigns/ssaDefInitializesParam to ssaDefHasSource.
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,6 +1023,12 @@ private module DataFlowIntegrationInput implements Impl::DataFlowIntegrationInpu
|
||||
|
||||
Expr getARead(Definition def) { exists(getAReadAtNode(def, result)) }
|
||||
|
||||
predicate ssaDefHasSource(WriteDefinition def) {
|
||||
// exclude flow directly from RHS to SSA definition, as we instead want to
|
||||
// go from RHS to matching assignable definition, and from there to SSA definition
|
||||
def instanceof Ssa::ImplicitParameterDefinition
|
||||
}
|
||||
|
||||
predicate ssaDefAssigns(WriteDefinition def, Expr value) {
|
||||
// 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
|
||||
@@ -1031,7 +1037,7 @@ private module DataFlowIntegrationInput implements Impl::DataFlowIntegrationInpu
|
||||
|
||||
class Parameter = Ssa::ImplicitParameterDefinition;
|
||||
|
||||
predicate ssaDefInitializesParam(WriteDefinition def, Parameter p) { def = p }
|
||||
predicate ssaDefInitializesParam(WriteDefinition def, Parameter p) { none() }
|
||||
|
||||
/**
|
||||
* Allows for flow into uncertain defintions that are not call definitions,
|
||||
|
||||
Reference in New Issue
Block a user