mirror of
https://github.com/github/codeql.git
synced 2026-04-28 02:05:14 +02:00
Python: Change all remaining occurrences of StrConst
Done using ``` git grep StrConst | xargs sed -i 's/StrConst/StringLiteral/g' ```
This commit is contained in:
@@ -9,7 +9,7 @@ import python
|
||||
predicate hasattr(CallNode c, ControlFlowNode obj, string attr) {
|
||||
c.getFunction().getNode().(Name).getId() = "hasattr" and
|
||||
c.getArg(0) = obj and
|
||||
c.getArg(1).getNode().(StrConst).getText() = attr
|
||||
c.getArg(1).getNode().(StringLiteral).getText() = attr
|
||||
}
|
||||
|
||||
/** Holds if `c` is a call to `isinstance(use, cls)`. */
|
||||
|
||||
@@ -691,7 +691,7 @@ module PointsToInternal {
|
||||
sub.getObject() = sys_modules_flow and
|
||||
pointsTo(sys_modules_flow, _, ObjectInternal::sysModules(), _) and
|
||||
sub.getIndex() = n and
|
||||
n.getNode().(StrConst).getText() = name and
|
||||
n.getNode().(StringLiteral).getText() = name and
|
||||
sub.(DefinitionNode).getValue() = mod and
|
||||
pointsTo(mod, _, m, _)
|
||||
)
|
||||
|
||||
@@ -253,7 +253,7 @@ predicate executes_in_runtime_context(Function f) {
|
||||
}
|
||||
|
||||
private predicate maybe_main(Module m) {
|
||||
exists(If i, Compare cmp, Name name, StrConst main | m.getAStmt() = i and i.getTest() = cmp |
|
||||
exists(If i, Compare cmp, Name name, StringLiteral main | m.getAStmt() = i and i.getTest() = cmp |
|
||||
cmp.compares(name, any(Eq eq), main) and
|
||||
name.getId() = "__name__" and
|
||||
main.getText() = "__main__"
|
||||
|
||||
Reference in New Issue
Block a user