Skip to content

Expose CallGraphSCC.subNodes, ICFG.getICFGEdge, CallICFGNode.arg_size, null-mem constants#58

Merged
bjjwwang merged 1 commit into
SVF-tools:mainfrom
bjjwwang:feat/expose-bindings-upstream
Jun 3, 2026
Merged

Expose CallGraphSCC.subNodes, ICFG.getICFGEdge, CallICFGNode.arg_size, null-mem constants#58
bjjwwang merged 1 commit into
SVF-tools:mainfrom
bjjwwang:feat/expose-bindings-upstream

Conversation

@bjjwwang

@bjjwwang bjjwwang commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

What

Adds a few Python bindings (+ .pyi stubs) so interprocedural-WTO / abstract-execution code can mirror the C++ SVF API without workarounds:

Binding Why
CallGraphSCC.subNodes(rep) Call-graph node IDs of an SCC (complements the existing repNode); lets callers reconstruct call-graph SCCs for interprocedural WTO / recursion.
ICFG.getICFGEdge(src, dst, kind=0) Fetch the edge between two nodes (0=IntraCF, 1=CallCF, 2=RetCF; None if absent).
CallICFGNode.arg_size() Number of actual arguments at a call site.
NullMemAddr / BlackHoleObjAddr (module constants) From AddressValue.h, re-exported via pysvf/__init__.py, so null / black-hole addresses don't need hard-coded literals.

Files

  • pybind/Graphs.cppsubNodes, getICFGEdge, arg_size
  • pybind/AE.cppNullMemAddr / BlackHoleObjAddr module attributes
  • pysvf/__init__.py — re-export the two constants
  • pysvf/pysvf.pyi — stub entries for all four

Verification

  • Builds against current SVF; all symbols work at runtime (subNodes returns the SCC member list, arg_size the argument count, getICFGEdge the edge / None, constants resolve to 0x7f000000 / 0x7f000002).
  • stubtest reports no errors for any of the added symbols (the new .pyi entries match the runtime). Pre-existing stubtest drift unrelated to this change is untouched.

Motivation

Hit while porting an abstract-execution analysis to pysvf: the interprocedural WTO needed CallGraphSCC.subNodes (only repNode/isInCycle were exposed), phi/branch handling wanted getICFGEdge, ext-call handling wanted arg_size, and null modelling needed the address constants. All were worked around in Python; these bindings remove the workarounds.

🤖 Generated with Claude Code

…, null-mem constants

Adds Python bindings (+ .pyi stubs) so interprocedural-WTO / abstract-execution
code can mirror the C++ SVF API without workarounds:

- CallGraphSCC.subNodes(rep): call-graph node IDs in an SCC (complements the
  existing repNode), so callers can reconstruct call-graph SCCs for
  interprocedural WTO / recursion handling.
- ICFG.getICFGEdge(src, dst, kind=0): fetch the IntraCF/CallCF/RetCF edge
  (0=IntraCF, 1=CallCF, 2=RetCF; None if absent).
- CallICFGNode.arg_size(): number of actual arguments at a call site.
- Module constants NullMemAddr / BlackHoleObjAddr (from AddressValue.h),
  re-exported via pysvf/__init__.py, so null / black-hole addresses no longer
  need hard-coded literals.

pysvf.pyi updated for all four; stubtest reports no errors for the new symbols.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@bjjwwang bjjwwang merged commit eae6799 into SVF-tools:main Jun 3, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant