Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Assignment-3/CPP/Assignment_3.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -122,7 +122,7 @@ namespace SVF {

/// Destructor
virtual ~AbstractExecution() {
delete svfStateMgr;
// svfStateMgr is the AbstractInterpretation singleton; SVF owns its lifetime.
}

protected:
Expand All @@ -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<const FunObjVar*, ICFGWTO*> funcToWTO;
Expand Down
7 changes: 5 additions & 2 deletions Assignment-3/CPP/Assignment_3_Helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 8 additions & 4 deletions Assignment-3/Python/Assignment_3_Helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""
Expand All @@ -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`).
Expand Down Expand Up @@ -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
Expand Down
Loading