40 class AbstractInterpretation;
45 template<
typename T>
class FILOWorkList;
263 assert(0 &&
"No preAbsTrace for this node");
310 {CmpStmt::Predicate::FCMP_OEQ, CmpStmt::Predicate::FCMP_ONE},
311 {CmpStmt::Predicate::FCMP_UEQ, CmpStmt::Predicate::FCMP_UNE},
312 {CmpStmt::Predicate::FCMP_OGT, CmpStmt::Predicate::FCMP_OLE},
313 {CmpStmt::Predicate::FCMP_OGE, CmpStmt::Predicate::FCMP_OLT},
314 {CmpStmt::Predicate::FCMP_OLT, CmpStmt::Predicate::FCMP_OGE},
315 {CmpStmt::Predicate::FCMP_OLE, CmpStmt::Predicate::FCMP_OGT},
316 {CmpStmt::Predicate::FCMP_ONE, CmpStmt::Predicate::FCMP_OEQ},
317 {CmpStmt::Predicate::FCMP_UNE, CmpStmt::Predicate::FCMP_UEQ},
318 {CmpStmt::Predicate::ICMP_EQ, CmpStmt::Predicate::ICMP_NE},
319 {CmpStmt::Predicate::ICMP_NE, CmpStmt::Predicate::ICMP_EQ},
320 {CmpStmt::Predicate::ICMP_UGT, CmpStmt::Predicate::ICMP_ULE},
321 {CmpStmt::Predicate::ICMP_ULT, CmpStmt::Predicate::ICMP_UGE},
322 {CmpStmt::Predicate::ICMP_UGE, CmpStmt::Predicate::ICMP_ULT},
323 {CmpStmt::Predicate::ICMP_SGT, CmpStmt::Predicate::ICMP_SLE},
324 {CmpStmt::Predicate::ICMP_SLT, CmpStmt::Predicate::ICMP_SGE},
325 {CmpStmt::Predicate::ICMP_SGE, CmpStmt::Predicate::ICMP_SLT},
331 {CmpStmt::Predicate::FCMP_OEQ, CmpStmt::Predicate::FCMP_OEQ},
332 {CmpStmt::Predicate::FCMP_UEQ, CmpStmt::Predicate::FCMP_UEQ},
333 {CmpStmt::Predicate::FCMP_OGT, CmpStmt::Predicate::FCMP_OLT},
334 {CmpStmt::Predicate::FCMP_OGE, CmpStmt::Predicate::FCMP_OLE},
335 {CmpStmt::Predicate::FCMP_OLT, CmpStmt::Predicate::FCMP_OGT},
336 {CmpStmt::Predicate::FCMP_OLE, CmpStmt::Predicate::FCMP_OGE},
337 {CmpStmt::Predicate::FCMP_ONE, CmpStmt::Predicate::FCMP_ONE},
338 {CmpStmt::Predicate::FCMP_UNE, CmpStmt::Predicate::FCMP_UNE},
339 {CmpStmt::Predicate::ICMP_EQ, CmpStmt::Predicate::ICMP_EQ},
340 {CmpStmt::Predicate::ICMP_NE, CmpStmt::Predicate::ICMP_NE},
341 {CmpStmt::Predicate::ICMP_UGT, CmpStmt::Predicate::ICMP_ULT},
342 {CmpStmt::Predicate::ICMP_ULT, CmpStmt::Predicate::ICMP_UGT},
343 {CmpStmt::Predicate::ICMP_UGE, CmpStmt::Predicate::ICMP_ULE},
344 {CmpStmt::Predicate::ICMP_SGT, CmpStmt::Predicate::ICMP_SLT},
345 {CmpStmt::Predicate::ICMP_SLT, CmpStmt::Predicate::ICMP_SGT},
346 {CmpStmt::Predicate::ICMP_SGE, CmpStmt::Predicate::ICMP_SLE},
AEStat: Statistic for AE.
void performStat() override
u32_t & getFunctionTrace()
AEStat(AbstractInterpretation *ae)
std::string getMemUsage()
AbstractInterpretation * _ae
u32_t & getICFGNodeTrace()
Handles external API calls and manages abstract states.
AbstractInterpretation is same as Abstract Execution.
void updateStateOnCall(const CallPE *callPE)
virtual bool isRecursiveCall(const CallICFGNode *callNode)
virtual void recursiveCallPass(const CallICFGNode *callNode)
Map< std::string, std::function< void(const CallICFGNode *)> > func_map
void updateStateOnStore(const StoreStmt *store)
virtual bool isDirectCall(const CallICFGNode *callNode)
bool hasAbsStateFromTrace(const ICFGNode *node)
Map< const SVFFunction *, ICFGWTO * > funcToWTO
virtual void handleCycleWTO(const ICFGCycleWTO *cycle)
handle wto cycle (loop)
void updateStateOnGep(const GepStmt *gep)
void analyse()
Program entry.
virtual void extCallPass(const CallICFGNode *callNode)
virtual void handleGlobalNode()
Global ICFGNode is handled at the entry of the program,.
bool mergeStatesFromPredecessors(const ICFGNode *icfgNode)
virtual void directCallFunPass(const CallICFGNode *callNode)
void handleWTOComponent(const ICFGWTOComp *wtoComp)
virtual bool isExtCall(const CallICFGNode *callNode)
virtual bool isIndirectCall(const CallICFGNode *callNode)
void initWTO()
Mark recursive functions in the call graph.
SCCDetection< PTACallGraph * > CallGraphSCC
AbstractInterpretation()
Constructor.
void updateStateOnPhi(const PhiStmt *phi)
bool isBranchFeasible(const IntraCFGEdge *intraEdge, AbstractState &as)
std::vector< std::unique_ptr< AEDetector > > detectors
void addDetector(std::unique_ptr< AEDetector > detector)
Set< const CallICFGNode * > checkpoints
bool isSwitchBranchFeasible(const SVFVar *var, s64_t succ, AbstractState &as)
Map< s32_t, s32_t > _reverse_predicate
Set< const SVFFunction * > recursiveFuns
void updateStateOnSelect(const SelectStmt *select)
virtual void handleSVFStatement(const SVFStmt *stmt)
virtual void indirectCallFunPass(const CallICFGNode *callNode)
SVFIR * svfir
protected data members, also used in subclasses
virtual void runOnModule(ICFG *icfg)
static AbstractInterpretation & getAEInstance()
void updateStateOnAddr(const AddrStmt *addr)
virtual ~AbstractInterpretation()
Destructor.
bool isCmpBranchFeasible(const CmpStmt *cmpStmt, s64_t succ, AbstractState &as)
virtual void handleCallSite(const ICFGNode *node)
void updateStateOnRet(const RetPE *retPE)
void handleWTOComponents(const std::list< const ICFGWTOComp * > &wtoComps)
Hanlde two types of WTO components (singleton and cycle)
void updateStateOnCopy(const CopyStmt *copy)
AbstractState & getAbsStateFromTrace(const ICFGNode *node)
AEAPI * api
Execution State, used to store the Interval Value of every SVF variable.
void updateStateOnLoad(const LoadStmt *load)
void updateStateOnBinary(const BinaryOPStmt *binary)
Map< const ICFGNode *, AbstractState > abstractTrace
std::vector< const CallICFGNode * > callSiteStack
virtual void handleSingletonWTO(const ICFGSingletonWTO *icfgSingletonWto)
handle instructions in svf basic blocks
Map< s32_t, s32_t > _switch_lhsrhs_predicate
void updateStateOnCmp(const CmpStmt *cmp)
virtual void SkipRecursiveCall(const CallICFGNode *callnode)
Detector for identifying buffer overflow issues.
const ICFGNode * getRepNode(const ICFGNode *node) const
static double getClk(bool mark=false)
bool getMemoryUsageKB(u32_t *vmrss_kb, u32_t *vmsize_kb)
Get memory usage from system file. Return TRUE if succeed.
constexpr std::remove_reference< T >::type && move(T &&t) noexcept
std::unordered_map< Key, Value, Hash, KeyEqual, Allocator > Map
std::unordered_set< Key, Hash, KeyEqual, Allocator > Set