Expose CallGraphSCC.subNodes, ICFG.getICFGEdge, CallICFGNode.arg_size, null-mem constants#58
Merged
Conversation
…, 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a few Python bindings (+
.pyistubs) so interprocedural-WTO / abstract-execution code can mirror the C++ SVF API without workarounds:CallGraphSCC.subNodes(rep)repNode); lets callers reconstruct call-graph SCCs for interprocedural WTO / recursion.ICFG.getICFGEdge(src, dst, kind=0)Noneif absent).CallICFGNode.arg_size()NullMemAddr/BlackHoleObjAddr(module constants)AddressValue.h, re-exported viapysvf/__init__.py, so null / black-hole addresses don't need hard-coded literals.Files
pybind/Graphs.cpp—subNodes,getICFGEdge,arg_sizepybind/AE.cpp—NullMemAddr/BlackHoleObjAddrmodule attributespysvf/__init__.py— re-export the two constantspysvf/pysvf.pyi— stub entries for all fourVerification
subNodesreturns the SCC member list,arg_sizethe argument count,getICFGEdgethe edge /None, constants resolve to0x7f000000/0x7f000002).stubtestreports no errors for any of the added symbols (the new.pyientries 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(onlyrepNode/isInCyclewere exposed), phi/branch handling wantedgetICFGEdge, ext-call handling wantedarg_size, and null modelling needed the address constants. All were worked around in Python; these bindings remove the workarounds.🤖 Generated with Claude Code