Skip to content

Commit 4f08fdd

Browse files
committed
Rust: Make the two cases read more similarly.
1 parent 3e0e374 commit 4f08fdd

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

rust/ql/src/queries/security/CWE-696/BadCtorInitialization.ql

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,10 @@ class PathElement = AstNode;
4141

4242
query predicate edges(PathElement pred, PathElement succ) {
4343
// starting edge (`#[ctor]` / `#[dtor]` attribute to call)
44-
exists(CtorAttr ctor, Function f, CallExprBase call |
44+
exists(CtorAttr ctor, Function f |
4545
f.getAnAttr() = ctor and
46-
call.getEnclosingCallable() = f and
4746
pred = ctor and
48-
succ = call
47+
succ.(CallExprBase).getEnclosingCallable() = f
4948
)
5049
or
5150
// transitive edge (call to call)

0 commit comments

Comments
 (0)