Skip to content

Commit aece0ff

Browse files
yofftausbn
andauthored
Apply suggestions from code review
Co-authored-by: Taus <tausbn@github.com>
1 parent 131cf8d commit aece0ff

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

python/ql/src/experimental/dataflow/internal/DataFlowPrivate.qll

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ private Node update(Node node) {
229229
/**
230230
* IPA type for DataFlowCallable.
231231
*
232-
* A callable is either a callable value or a module (for enclosing `ModuleVariable`s).
232+
* A callable is either a callable value or a module (for enclosing `ModuleVariableNode`s).
233233
* A module has no calls.
234234
*/
235235
newtype TDataFlowCallable =
@@ -292,13 +292,13 @@ class DataFlowModuleScope extends DataFlowCallable, TModule {
292292
* IPA type for DataFlowCall.
293293
*
294294
* Calls corresponding to `CallNode`s are either to callable values or to classes.
295-
* The latter is directed to the callable corresponding to the calss' `__init__`-method.
295+
* The latter is directed to the callable corresponding to the `__init__` method of the class.
296296
*
297-
* An `__init__`-method can also be called directly, so that callable can be targetted by
297+
* An `__init__` method can also be called directly, so that the callable can be targeted by
298298
* different types of calls. In that case, the parameter mappings will be different,
299299
* as the class call will synthesise an argument node to be mapped to the `self` parameter.
300300
*
301-
* A calls corresponding to a special method call is handled by the corresponding `SpecialMethodCallNode`.
301+
* A call corresponding to a special method call is handled by the corresponding `SpecialMethodCallNode`.
302302
*/
303303
newtype TDataFlowCall =
304304
TCallNode(CallNode call) { call = any(CallableValue c).getACall() } or
@@ -406,12 +406,12 @@ class ArgumentNode extends Node {
406406
final DataFlowCall getCall() { this.argumentOf(result, _) }
407407

408408
predicate isNotPostUpdate() {
409-
// Avoid argument 0 of class calls as those have non-synthetic post-update nodes.
410-
exists(CallNodeCall c | this = c.getArg(_))
409+
this = any(CallNodeCall c).getArg(_)
411410
or
412-
exists(ClassCall c, int n | n > 0 | this = c.getArg(n))
411+
this = any(SpecialCall c).getArg(_)
413412
or
414-
exists(SpecialCall c | this = c.getArg(_))
413+
// Avoid argument 0 of class calls as those have non-synthetic post-update nodes.
414+
exists(ClassCall c, int n | n > 0 | this = c.getArg(n))
415415
}
416416
}
417417

python/ql/src/experimental/dataflow/internal/DataFlowPublic.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ class ParameterNode extends EssaNode {
163163
*
164164
* Nodes corresponding to AST elements, for example `ExprNode`s, usually refer
165165
* to the value before the update with the exception of `ObjectCreationNode`s,
166-
* which represents the value after the constructor has run.
166+
* which represents the value _after_ the constructor has run.
167167
*/
168168
abstract class PostUpdateNode extends Node {
169169
/** Gets the node before the state update. */

0 commit comments

Comments
 (0)