mirror of
https://github.com/github/codeql.git
synced 2025-12-22 11:46:32 +01:00
Adding Initializer in condition as an occurance of isDef
This commit is contained in:
@@ -169,7 +169,10 @@ class AnalysedExpr extends Expr {
|
|||||||
*/
|
*/
|
||||||
predicate isDef(LocalScopeVariable v) {
|
predicate isDef(LocalScopeVariable v) {
|
||||||
this.inCondition() and
|
this.inCondition() and
|
||||||
this.(Assignment).getLValue() = v.getAnAccess()
|
(
|
||||||
|
this.(Assignment).getLValue() = v.getAnAccess() or
|
||||||
|
exists(Initializer i | this.getEnclosingStmt() = i.getEnclosingStmt() and v = i.getDeclaration())
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user