File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed
Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -72,14 +72,12 @@ class OsCloseCall extends FileClose {
7272
7373/** A `with` statement. */
7474class WithStatement extends FileClose {
75- With w;
76-
77- WithStatement() { this.asExpr() = w.getContextExpr() }
75+ WithStatement() { this.asExpr() = any(With w).getContextExpr() }
7876}
7977
8078/** Holds if an exception may be raised at `raises` if `file` is a file object. */
8179private predicate mayRaiseWithFile(DataFlow::CfgNode file, DataFlow::CfgNode raises) {
82- // Currently just consider any method called on `node `; e.g. `file.write()`; as potentially raising an exception
80+ // Currently just consider any method called on `file `; e.g. `file.write()`; as potentially raising an exception
8381 raises.(DataFlow::MethodCallNode).getObject() = file and
8482 not file instanceof FileOpen and
8583 not file instanceof FileClose
You can’t perform that action at this time.
0 commit comments