Adding Initializer in condition as an occurance of isDef

This commit is contained in:
REDMOND\brodes
2022-07-07 10:32:36 -04:00
parent 74ff579dbc
commit 4379aa4398

View File

@@ -169,7 +169,10 @@ class AnalysedExpr extends Expr {
*/
predicate isDef(LocalScopeVariable v) {
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())
)
}
/**