mirror of
https://github.com/github/codeql.git
synced 2026-04-30 19:26:02 +02:00
Python: Remove points-to from Expr
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
*/
|
||||
|
||||
import python
|
||||
private import LegacyPointsTo
|
||||
import Variables.MonkeyPatched
|
||||
import Loop
|
||||
import semmle.python.pointsto.PointsTo
|
||||
@@ -95,7 +96,7 @@ predicate undefined_use(Name u) {
|
||||
not contains_unknown_import_star(u.getEnclosingModule()) and
|
||||
not use_of_exec(u.getEnclosingModule()) and
|
||||
not exists(u.getVariable().getAStore()) and
|
||||
not u.pointsTo(_) and
|
||||
not u.(ExprWithPointsTo).pointsTo(_) and
|
||||
not probably_defined_in_loop(u)
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
*/
|
||||
|
||||
import python
|
||||
private import LegacyPointsTo
|
||||
import Undefined
|
||||
import semmle.python.pointsto.PointsTo
|
||||
|
||||
@@ -30,7 +31,7 @@ predicate uninitialized_local(NameNode use) {
|
||||
predicate explicitly_guarded(NameNode u) {
|
||||
exists(Try t |
|
||||
t.getBody().contains(u.getNode()) and
|
||||
t.getAHandler().getType().pointsTo(ClassValue::nameError())
|
||||
t.getAHandler().getType().(ExprWithPointsTo).pointsTo(ClassValue::nameError())
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user