Static Value-Flow Analysis
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
SVF::AEDetector Class Referenceabstract

Base class for all detectors. More...

#include <AEDetector.h>

Inheritance diagram for SVF::AEDetector:
SVF::BufOverflowDetector

Public Types

enum  DetectorKind { BUF_OVERFLOW , UNKNOWN }
 Enumerates the types of detectors available. More...
 

Public Member Functions

 AEDetector ()
 Constructor initializes the detector kind to UNKNOWN. More...
 
virtual ~AEDetector ()=default
 Virtual destructor for safe polymorphic use. More...
 
virtual void detect (AbstractState &as, const ICFGNode *node)=0
 Pure virtual function for detecting issues within a node. More...
 
virtual void handleStubFunctions (const CallICFGNode *call)=0
 Pure virtual function for handling stub external API calls. (e.g. UNSAFE_BUFACCESS) More...
 
virtual void reportBug ()=0
 Pure virtual function to report detected bugs. More...
 
DetectorKind getKind () const
 Get the kind of the detector. More...
 

Static Public Member Functions

static bool classof (const AEDetector *detector)
 Check if the detector is of the UNKNOWN kind. More...
 

Protected Attributes

DetectorKind kind
 The kind of the detector. More...
 

Detailed Description

Base class for all detectors.

Definition at line 38 of file AEDetector.h.

Member Enumeration Documentation

◆ DetectorKind

Enumerates the types of detectors available.

Enumerator
BUF_OVERFLOW 

Detector for buffer overflow issues.

UNKNOWN 

Default type if the kind is not specified.

Definition at line 45 of file AEDetector.h.

46  {
47  BUF_OVERFLOW,
48  UNKNOWN,
49  };
@ UNKNOWN
Default type if the kind is not specified.
Definition: AEDetector.h:48
@ BUF_OVERFLOW
Detector for buffer overflow issues.
Definition: AEDetector.h:47

Constructor & Destructor Documentation

◆ AEDetector()

SVF::AEDetector::AEDetector ( )
inline

Constructor initializes the detector kind to UNKNOWN.

Definition at line 54 of file AEDetector.h.

54 : kind(UNKNOWN) {}
DetectorKind kind
The kind of the detector.
Definition: AEDetector.h:99

◆ ~AEDetector()

virtual SVF::AEDetector::~AEDetector ( )
virtualdefault

Virtual destructor for safe polymorphic use.

Member Function Documentation

◆ classof()

static bool SVF::AEDetector::classof ( const AEDetector detector)
inlinestatic

Check if the detector is of the UNKNOWN kind.

Parameters
detectorPointer to the detector.
Returns
True if the detector is of type UNKNOWN, false otherwise.

Definition at line 66 of file AEDetector.h.

67  {
68  return detector->getKind() == AEDetector::UNKNOWN;
69  }

◆ detect()

virtual void SVF::AEDetector::detect ( AbstractState as,
const ICFGNode node 
)
pure virtual

Pure virtual function for detecting issues within a node.

Parameters
asReference to the abstract state.
nodePointer to the ICFG node.

Implemented in SVF::BufOverflowDetector.

◆ getKind()

DetectorKind SVF::AEDetector::getKind ( ) const
inline

Get the kind of the detector.

Returns
The kind of the detector.

Definition at line 93 of file AEDetector.h.

94  {
95  return kind;
96  }

◆ handleStubFunctions()

virtual void SVF::AEDetector::handleStubFunctions ( const CallICFGNode call)
pure virtual

Pure virtual function for handling stub external API calls. (e.g. UNSAFE_BUFACCESS)

Parameters
callPointer to the ext call ICFG node.

Implemented in SVF::BufOverflowDetector.

◆ reportBug()

virtual void SVF::AEDetector::reportBug ( )
pure virtual

Pure virtual function to report detected bugs.

Implemented in SVF::BufOverflowDetector.

Member Data Documentation

◆ kind

DetectorKind SVF::AEDetector::kind
protected

The kind of the detector.

Definition at line 99 of file AEDetector.h.


The documentation for this class was generated from the following file: