mirror of
https://github.com/github/codeql.git
synced 2026-04-28 10:15:14 +02:00
Fix isImplicitInit; use it in empty-container query
This commit is contained in:
@@ -40,6 +40,6 @@ where
|
||||
) and
|
||||
// Also, any value that `v` is initialized to is a fresh container,
|
||||
forall(Expr e | e = v.getAnAssignedValue() | e instanceof FreshContainer) and
|
||||
// and `v` is not implicitly initialized by a for-each loop.
|
||||
not exists(EnhancedForStmt efs | efs.getVariable().getVariable() = v)
|
||||
// and `v` is not implicitly initialized.
|
||||
not v.(LocalVariableDecl).getDeclExpr().hasImplicitInit()
|
||||
select v, "The contents of this container are never initialized."
|
||||
|
||||
Reference in New Issue
Block a user