Python: Remove points-to to from ControlFlowNode

Moves the existing points-to predicates to the newly added class
`ControlFlowNodeWithPointsTo` which resides in the `LegacyPointsTo`
module.

(Existing code that uses these predicates should import this module, and
references to `ControlFlowNode` should be changed to
`ControlFlowNodeWithPointsTo`.)

Also updates all existing points-to based code to do just this.
This commit is contained in:
Taus
2025-10-29 22:05:43 +00:00
parent 4461be180a
commit fef08afff9
75 changed files with 410 additions and 236 deletions

View File

@@ -1,10 +1,11 @@
import python
private import LegacyPointsTo
from ClassValue cls, string res
where
exists(CallNode call |
call.getFunction().(NameNode).getId() = "test" and
call.getAnArg().pointsTo(cls)
call.getAnArg().(ControlFlowNodeWithPointsTo).pointsTo(cls)
) and
(
cls.isSequence() and

View File

@@ -1,6 +1,7 @@
import python
private import LegacyPointsTo
from int line, ControlFlowNode f, Object o, ControlFlowNode orig
from int line, ControlFlowNodeWithPointsTo f, Object o, ControlFlowNode orig
where
not f.getLocation().getFile().inStdlib() and
f.refersTo(o, orig) and

View File

@@ -1,6 +1,7 @@
import python
private import LegacyPointsTo
from int line, ControlFlowNode f, Object o, ControlFlowNode orig
from int line, ControlFlowNodeWithPointsTo f, Object o, ControlFlowNode orig
where
not f.getLocation().getFile().inStdlib() and
f.refersTo(o, orig) and

View File

@@ -1,6 +1,7 @@
import python
private import LegacyPointsTo
from int line, ControlFlowNode f, Object o, ClassObject cls, ControlFlowNode orig
from int line, ControlFlowNodeWithPointsTo f, Object o, ClassObject cls, ControlFlowNode orig
where
not f.getLocation().getFile().inStdlib() and
f.refersTo(o, cls, orig) and

View File

@@ -1,8 +1,9 @@
import python
private import LegacyPointsTo
string short_loc(Location l) { result = l.getFile().getShortName() + ":" + l.getStartLine() }
from ControlFlowNode use, Object obj, ControlFlowNode orig, int line
from ControlFlowNodeWithPointsTo use, Object obj, ControlFlowNode orig, int line
where
use.refersTo(obj, orig) and
use.getLocation().getFile().getShortName() = "test.py" and