Commit 6814bcf
Python: SSA adapter: add MultiAssignmentDefinition, definedBy, useOfDef
Extends the ESSA-shaped adapter on top of the new shared SSA with the
remaining APIs consumed by the dataflow library:
* MultiAssignmentDefinition: matches the AST pattern 'a, b = ...' where
the LHS is a Tuple/List and the Name being defined is a sub-element.
Used by IterableUnpacking.qll to recognise unpacking assignments.
* EssaNodeDefinition.definedBy(var, defNode): a flatter equivalent of
'getSourceVariable() = var and getDefiningNode() = defNode', matching
legacy ESSA's signature. Used by DataFlowPublic.qll's
ModuleVariableNode to enumerate writes of a global.
* AdjacentUses::useOfDef(def, use): all reachable uses of a definition
(firstUse plus transitive use-use adjacency). Used by guards in
DataFlowPublic.qll.
These complete the API surface enumerated by grep across the dataflow
library. The remaining items (EssaNodeRefinement, EssaImportStep) are
ImportResolution-specific and will need separate treatment, possibly via
a different abstraction since the SSA library does not model heap-state
refinements like 'foo.bar = X'.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 7521d83 commit 6814bcf
1 file changed
Lines changed: 36 additions & 0 deletions
Lines changed: 36 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
238 | 238 | | |
239 | 239 | | |
240 | 240 | | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
241 | 250 | | |
242 | 251 | | |
243 | 252 | | |
| |||
301 | 310 | | |
302 | 311 | | |
303 | 312 | | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
304 | 330 | | |
305 | 331 | | |
306 | 332 | | |
| |||
384 | 410 | | |
385 | 411 | | |
386 | 412 | | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
387 | 423 | | |
0 commit comments