Skip to content

Commit 862e370

Browse files
bjjwwangclaude
andcommitted
Port Assignment-3/CPP from AbstractStateManager to AbstractInterpretation
Upstream SVF folded the AbstractStateManager class back into the .cpp implementations and removed the public AE/Svfexe/AbstractStateManager.h header. Assignment_3.h still tried to include that header, so the macOS-latest CI fails with: Assignment-3/CPP/Assignment_3.h:29:10: fatal error: 'AE/Svfexe/AbstractStateManager.h' file not found The methods Assignment-3 actually uses on the manager — getTrace(), operator[], getGepByteOffset() — are now on AbstractInterpretation. Switch the field type to AbstractInterpretation* and obtain it via the upstream singleton (AbstractInterpretation::getAEInstance()). The singleton wires SVFIR from PAG::getPAG() internally, so we no longer need to construct an explicit Andersen analysis just to feed the manager. The destructor used to 'delete svfStateMgr'; that's wrong for the singleton (SVF owns its lifetime), so drop it. Verified locally: docker run ubuntu:24.04 with svf-lib (v1.0.2555) + LLVM 21.1.0 prebuilt + Z3, cmake . && make -j4 builds 100% — both libassign3 and the ass3 binary link cleanly. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent defba7a commit 862e370

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

Assignment-3/CPP/Assignment_3.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
*/
2727
#include "Assignment_3_Helper.h"
2828
#include "AE/Svfexe/AbsExtAPI.h"
29-
#include "AE/Svfexe/AbstractStateManager.h"
29+
#include "AE/Svfexe/AbstractInterpretation.h"
3030
#include "SVFIR/SVFIR.h"
3131

3232
namespace SVF {
@@ -122,7 +122,7 @@ namespace SVF {
122122

123123
/// Destructor
124124
virtual ~AbstractExecution() {
125-
delete svfStateMgr;
125+
// svfStateMgr is the AbstractInterpretation singleton; SVF owns its lifetime.
126126
}
127127

128128
protected:
@@ -133,7 +133,7 @@ namespace SVF {
133133
/// AbsExtAPI and the GEP/load/store helpers (getGepByteOffset etc.)
134134
/// read and write through this manager; we don't keep a separate
135135
/// postAbsTrace map any more.
136-
AbstractStateManager* svfStateMgr = nullptr;
136+
AbstractInterpretation* svfStateMgr = nullptr;
137137

138138
/// Map a function to its corresponding WTO
139139
Map<const FunObjVar*, ICFGWTO*> funcToWTO;

Assignment-3/CPP/Assignment_3_Helper.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -543,8 +543,11 @@ void AbstractExecution::ensureAllAssertsValidated() {
543543
void AbstractExecution::analyse() {
544544
// Init WTOs for all functions, and handle Global ICFGNode of SVFModule
545545
initWTO();
546-
AndersenWaveDiff* ander = AndersenWaveDiff::createAndersenWaveDiff(svfir);
547-
svfStateMgr = new AbstractStateManager(svfir, ander);
546+
// AbstractStateManager was folded into AbstractInterpretation upstream; the
547+
// header AE/Svfexe/AbstractStateManager.h was removed. Use the singleton
548+
// AbstractInterpretation; it pulls SVFIR from PAG::getPAG() internally and
549+
// does not need an explicit Andersen analysis to be passed in.
550+
svfStateMgr = &AbstractInterpretation::getAEInstance();
548551
utils = new AbsExtAPI(svfStateMgr);
549552

550553
// Handle the global node

0 commit comments

Comments
 (0)