mirror of
https://github.com/github/codeql.git
synced 2025-12-24 20:56:33 +01:00
Python: Move not this instanceof ParameterDefinition logic
This commit is contained in:
@@ -501,8 +501,7 @@ class AssignmentDefinition extends EssaNodeDefinition {
|
|||||||
ControlFlowNode value;
|
ControlFlowNode value;
|
||||||
|
|
||||||
AssignmentDefinition() {
|
AssignmentDefinition() {
|
||||||
SsaSource::assignment_definition(this.getSourceVariable(), this.getDefiningNode(), value) and
|
SsaSource::assignment_definition(this.getSourceVariable(), this.getDefiningNode(), value)
|
||||||
not this instanceof ParameterDefinition
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ControlFlowNode getValue() { result = value }
|
ControlFlowNode getValue() { result = value }
|
||||||
|
|||||||
@@ -20,7 +20,12 @@ module SsaSource {
|
|||||||
/** Holds if `v` is defined by assignment at `defn` and given `value`. */
|
/** Holds if `v` is defined by assignment at `defn` and given `value`. */
|
||||||
cached
|
cached
|
||||||
predicate assignment_definition(Variable v, ControlFlowNode defn, ControlFlowNode value) {
|
predicate assignment_definition(Variable v, ControlFlowNode defn, ControlFlowNode value) {
|
||||||
defn.(NameNode).defines(v) and defn.(DefinitionNode).getValue() = value
|
defn.(NameNode).defines(v) and
|
||||||
|
defn.(DefinitionNode).getValue() = value and
|
||||||
|
// since parameter will be considered a DefinitionNode, if it has a default value,
|
||||||
|
// we need to exclude it here since it is already covered by parameter_definition
|
||||||
|
// (and points-to was unhappy that it was included in both)
|
||||||
|
not parameter_definition(v, defn)
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Holds if `v` is defined by assignment of the captured exception. */
|
/** Holds if `v` is defined by assignment of the captured exception. */
|
||||||
|
|||||||
Reference in New Issue
Block a user