Fix stubtest + bind AbstractStateManager dict-protocol#49
Merged
bjjwwang merged 1 commit intoSVF-tools:mainfrom Apr 30, 2026
Merged
Fix stubtest + bind AbstractStateManager dict-protocol#49bjjwwang merged 1 commit intoSVF-tools:mainfrom
bjjwwang merged 1 commit intoSVF-tools:mainfrom
Conversation
The previous sync (51543e8) added pysvf.AbstractStateManager, AbstractInterpretation and Options to the binary but left the .pyi stub declaring the methods that the same commit removed from AbstractState. The release.yml `stubtest` job catches that drift and was failing on the sync-llvm-21 PR. This commit: pybind/AE.cpp: - Add __setitem__ (delegates to updateAbstractState) and __contains__ (delegates to hasAbstractState) on AbstractStateManager so Python code can use it as a drop-in replacement for the old `post_abs_trace` dict (Software-Security-Analysis Assignment-3 relies on this to wire the stateMgr in as the post-trace backing store). pysvf/pysvf.pyi: - Drop the seven AbstractState methods that the upstream Semi-Sparse refactor moved off the class: getElementIndex, getByteOffset, getPointeeElement, storeValue, loadValue, getAllocaInstByteSize, getGepObjAddrs. - Add type stubs for AbstractStateManager (full surface, including the dict-protocol additions), AbstractInterpretation, and Options so they are visible to mypy/pyright users. - Add GepStmt.getStructFieldOffset matching the new lambda binding. stubtest_allowlist.txt: - Whitelist the new pybind classes (AbstractStateManager, AbstractInterpretation, Options) using the same `pysvf.<Name>` shape that already exempts AbstractState/AbstractValue/etc. The pybind11 metaclass + auto-generated `__init__(*args, **kwargs)` always trip stubtest unless the class is allow-listed. Verified locally: stubtest reports `Success: no issues found in 4 modules`. Co-Authored-By: Claude Opus 4.7 (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.
The previous sync (51543e8) added pysvf.AbstractStateManager, AbstractInterpretation and Options to the binary but left the .pyi stub declaring the methods that the same commit removed from AbstractState. The release.yml
stubtestjob catches that drift and was failing on the sync-llvm-21 PR. This commit:pybind/AE.cpp:
post_abs_tracedict (Software-Security-Analysis Assignment-3 relies on this to wire the stateMgr in as the post-trace backing store).pysvf/pysvf.pyi:
stubtest_allowlist.txt:
pysvf.<Name>shape that already exempts AbstractState/AbstractValue/etc. The pybind11 metaclass + auto-generated__init__(*args, **kwargs)always trip stubtest unless the class is allow-listed.Verified locally: stubtest reports
Success: no issues found in 4 modules.