PS: Drive-by fix: The variable access in a foreach loop implicitly writes to the variable.

This commit is contained in:
Mathias Vorreiter Pedersen
2025-04-03 18:37:30 +01:00
parent 4d04b11468
commit 3acbd83297

View File

@@ -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
)
}
}
}