mirror of
https://github.com/github/codeql.git
synced 2026-04-29 18:55:14 +02:00
Python points-to: Track 'unknown' value through simple iteration.
This commit is contained in:
@@ -409,8 +409,8 @@ cached module PointsToInternal {
|
||||
scope_entry_points_to(def, context, value, origin)
|
||||
or
|
||||
InterModulePointsTo::implicit_submodule_points_to(def, context, value, origin)
|
||||
// or
|
||||
// iteration_definition_points_to(def, context, value, origin)
|
||||
or
|
||||
iteration_definition_points_to(def, context, value, origin)
|
||||
/*
|
||||
* No points-to for non-local function entry definitions yet.
|
||||
*/
|
||||
@@ -564,6 +564,11 @@ cached module PointsToInternal {
|
||||
)
|
||||
}
|
||||
|
||||
private predicate iteration_definition_points_to(IterationDefinition def, PointsToContext context, ObjectInternal value, ControlFlowNode origin) {
|
||||
pointsTo(def.getSequence(), context, ObjectInternal::unknown(), _) and
|
||||
value = ObjectInternal::unknown() and origin = def.getDefiningNode()
|
||||
}
|
||||
|
||||
/** Holds if `f` is an expression node `tval if cond else fval` and points to `(value, origin)`. */
|
||||
private predicate if_exp_points_to(IfExprNode f, PointsToContext context, ObjectInternal value, ControlFlowNode origin) {
|
||||
pointsTo(f.getAnOperand(), context, value, origin)
|
||||
|
||||
Reference in New Issue
Block a user