diff --git a/Assignment-3/CPP/Assignment_3.h b/Assignment-3/CPP/Assignment_3.h index da75f38..ccfde23 100644 --- a/Assignment-3/CPP/Assignment_3.h +++ b/Assignment-3/CPP/Assignment_3.h @@ -26,7 +26,7 @@ */ #include "Assignment_3_Helper.h" #include "AE/Svfexe/AbsExtAPI.h" -#include "AE/Svfexe/AbstractStateManager.h" +#include "AE/Svfexe/AbstractInterpretation.h" #include "SVFIR/SVFIR.h" namespace SVF { @@ -122,7 +122,7 @@ namespace SVF { /// Destructor virtual ~AbstractExecution() { - delete svfStateMgr; + // svfStateMgr is the AbstractInterpretation singleton; SVF owns its lifetime. } protected: @@ -133,7 +133,7 @@ namespace SVF { /// AbsExtAPI and the GEP/load/store helpers (getGepByteOffset etc.) /// read and write through this manager; we don't keep a separate /// postAbsTrace map any more. - AbstractStateManager* svfStateMgr = nullptr; + AbstractInterpretation* svfStateMgr = nullptr; /// Map a function to its corresponding WTO Map funcToWTO; diff --git a/Assignment-3/CPP/Assignment_3_Helper.cpp b/Assignment-3/CPP/Assignment_3_Helper.cpp index a0849a1..e8174af 100644 --- a/Assignment-3/CPP/Assignment_3_Helper.cpp +++ b/Assignment-3/CPP/Assignment_3_Helper.cpp @@ -543,8 +543,11 @@ void AbstractExecution::ensureAllAssertsValidated() { void AbstractExecution::analyse() { // Init WTOs for all functions, and handle Global ICFGNode of SVFModule initWTO(); - AndersenWaveDiff* ander = AndersenWaveDiff::createAndersenWaveDiff(svfir); - svfStateMgr = new AbstractStateManager(svfir, ander); + // AbstractStateManager was folded into AbstractInterpretation upstream; the + // header AE/Svfexe/AbstractStateManager.h was removed. Use the singleton + // AbstractInterpretation; it pulls SVFIR from PAG::getPAG() internally and + // does not need an explicit Andersen analysis to be passed in. + svfStateMgr = &AbstractInterpretation::getAEInstance(); utils = new AbsExtAPI(svfStateMgr); // Handle the global node diff --git a/Assignment-3/Python/Assignment_3_Helper.py b/Assignment-3/Python/Assignment_3_Helper.py index 02a5c97..87dce44 100644 --- a/Assignment-3/Python/Assignment_3_Helper.py +++ b/Assignment-3/Python/Assignment_3_Helper.py @@ -204,7 +204,7 @@ class AbstractExecutionHelper: managing GEP object offsets, and other utilities. """ - def __init__(self, svfir: pysvf.SVFIR, svf_state_mgr: pysvf.AbstractStateManager = None): + def __init__(self, svfir: pysvf.SVFIR, svf_state_mgr: 'pysvf.AbstractInterpretation' = None): """ Initialize member variables. """ @@ -222,7 +222,8 @@ def __init__(self, svfir: pysvf.SVFIR, svf_state_mgr: pysvf.AbstractStateManager # ------------------------------------------------------------------ # Helpers that used to live as instance methods on `pysvf.AbstractState`. - # Upstream (Semi-Sparse refactor) moved them to `AbstractStateManager`, + # Upstream (Semi-Sparse refactor) moved them to `AbstractInterpretation` + # (formerly `AbstractStateManager`, whose public header was removed), # which requires a sparsity-aware trace we don't keep here. We re-implement # the dense-mode behavior using only public AbstractState surface so the # Python side mirrors the C++ side (`AbstractExecutionHelper::getByteOffset`). @@ -446,8 +447,11 @@ def __init__(self, pag: pysvf.SVFIR): # as the GEP/load/store helpers (getGepByteOffset etc.). Replaces # the old `self.post_abs_trace` dict so reads/writes on # `self.post_abs_trace[node]` go through the mgr's trace. - self.ander = pysvf.AndersenWaveDiff(self.svfir) - self.svf_state_mgr = pysvf.AbstractStateManager(self.svfir, self.ander) + # AbstractStateManager was folded into AbstractInterpretation upstream + # (the AbstractStateManager.h header was removed). Use the + # AbstractInterpretation singleton; it pulls SVFIR from PAG::getPAG() + # internally and does not need an explicit Andersen instance. + self.svf_state_mgr = pysvf.AbstractInterpretation.getAEInstance() # Alias preserved so existing call-sites `self.post_abs_trace[node]` # keep working. The mgr supports __getitem__/__setitem__/__contains__. self.post_abs_trace = self.svf_state_mgr