mirror of
https://github.com/github/codeql.git
synced 2026-05-05 21:55:19 +02:00
Rust: Fix the false positives.
This commit is contained in:
@@ -99,11 +99,17 @@ module AccessAfterLifetime {
|
||||
// `b` is a child of `a`
|
||||
a = b.getEnclosingBlock*()
|
||||
or
|
||||
// propagate through function calls
|
||||
// propagate through function calls (static target)
|
||||
exists(CallExprBase ce |
|
||||
mayEncloseOnStack(a, ce.getEnclosingBlock()) and
|
||||
ce.getStaticTarget() = b.getEnclosingCallable()
|
||||
)
|
||||
or
|
||||
// propagate through function calls (runtime target)
|
||||
exists(Call c |
|
||||
mayEncloseOnStack(a, c.getEnclosingBlock()) and
|
||||
c.getARuntimeTarget() = b.getEnclosingCallable()
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user