Skip to content

Commit 50c91b9

Browse files
committed
Swaps correct_args_if_called_as_method globally
1 parent fb0cae7 commit 50c91b9

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

python/ql/src/Expressions/CallArgs.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ predicate wrong_args_objectapi(Call call, FunctionObject func, int limit, string
117117
* Implies nothing about whether `call` could call `func`.
118118
*/
119119
bindingset[call, func]
120-
predicate correct_args_if_called_as_method(Call call, FunctionObject func) {
120+
predicate correct_args_if_called_as_method_objectapi(Call call, FunctionObject func) {
121121
arg_count_objectapi(call)+1 >= func.minParameters()
122122
and
123123
arg_count_objectapi(call) < func.maxParameters()

python/ql/src/Expressions/WrongNumberArgumentsInCall.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ where
2222
too_few_args_objectapi(call, func, limit) and too = "too few arguments" and should = "no fewer than "
2323
) and
2424
not func.isAbstract() and
25-
not exists(FunctionObject overridden | func.overrides(overridden) and correct_args_if_called_as_method(call, overridden))
25+
not exists(FunctionObject overridden | func.overrides(overridden) and correct_args_if_called_as_method_objectapi(call, overridden))
2626
/* The semantics of `__new__` can be a bit subtle, so we simply exclude `__new__` methods */
2727
and not func.getName() = "__new__"
2828

python/ql/src/Functions/IncorrectlyOverriddenMethod.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import Expressions.CallArgs
1515
from Call call, FunctionObject func, FunctionObject overridden, string problem
1616
where
1717
func.overrides(overridden) and (
18-
wrong_args_objectapi(call, func, _, problem) and correct_args_if_called_as_method(call, overridden)
18+
wrong_args_objectapi(call, func, _, problem) and correct_args_if_called_as_method_objectapi(call, overridden)
1919
or
2020
exists(string name |
2121
illegally_named_parameter_objectapi(call, func, name) and problem = "an argument named '" + name + "'" and

python/ql/src/Functions/IncorrectlySpecifiedOverriddenMethod.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ where
1818
not func.getName() = "__init__" and
1919
overriding.overrides(func) and
2020
call = overriding.getAMethodCall().getNode() and
21-
correct_args_if_called_as_method(call, overriding) and
21+
correct_args_if_called_as_method_objectapi(call, overriding) and
2222
(
2323
arg_count_objectapi(call)+1 < func.minParameters() and problem = "too few arguments"
2424
or

0 commit comments

Comments
 (0)