mirror of
https://github.com/github/codeql.git
synced 2026-05-25 00:27:09 +02:00
PS: Drive-by fix: The variable access in a foreach loop implicitly writes to the variable.
This commit is contained in:
@@ -904,3 +904,15 @@ private module PipelineAccess {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private module ImplicitAssignmentInForEach {
|
||||
private class ForEachAssignment extends Synthesis {
|
||||
override predicate implicitAssignment(Raw::Ast dest, string name) {
|
||||
exists(Raw::ForEachStmt forEach, Raw::VarAccess va |
|
||||
va = forEach.getVarAccess() and
|
||||
va = dest and
|
||||
va.getUserPath() = name
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user