Static Value-Flow Analysis
Loading...
Searching...
No Matches
SVF::FileNeverCloseBug Class Reference

#include <SVFBugReport.h>

Inheritance diagram for SVF::FileNeverCloseBug:
SVF::GenericBug

Public Member Functions

 FileNeverCloseBug (const EventStack &bugEventStack)
cJSON * getBugDescription () const
void printBugToTerminal () const
Public Member Functions inherited from SVF::GenericBug
 GenericBug (BugType bugType, const EventStack &bugEventStack)
 note: should be initialized with a bugEventStack
virtual ~GenericBug ()=default
BugType getBugType () const
 returns bug type
const std::string getLoc () const
 returns bug location as json format string
const std::string getFuncName () const
 return bug source function name
const EventStack & getEventStack () const

Static Public Member Functions

static bool classof (const GenericBug *bug)
 ClassOf.

Additional Inherited Members

Public Types inherited from SVF::GenericBug
enum  BugType {
  FULLBUFOVERFLOW , PARTIALBUFOVERFLOW , NEVERFREE , PARTIALLEAK ,
  DOUBLEFREE , FILENEVERCLOSE , FILEPARTIALCLOSE , FULLNULLPTRDEREFERENCE ,
  PARTIALNULLPTRDEREFERENCE
}
typedef std::vector< SVFBugEvent > EventStack
Static Public Attributes inherited from SVF::GenericBug
static const OrderedMap< GenericBug::BugType, std::string > BugType2Str
Protected Attributes inherited from SVF::GenericBug
BugType bugType
const EventStack bugEventStack

Detailed Description

Definition at line 222 of file SVFBugReport.h.

Constructor & Destructor Documentation

◆ FileNeverCloseBug()

SVF::FileNeverCloseBug::FileNeverCloseBug ( const EventStack & bugEventStack)
inline

Definition at line 225 of file SVFBugReport.h.

225 :
GenericBug(BugType bugType, const EventStack &bugEventStack)
note: should be initialized with a bugEventStack
const EventStack bugEventStack

Member Function Documentation

◆ classof()

bool SVF::FileNeverCloseBug::classof ( const GenericBug * bug)
inlinestatic

ClassOf.

Definition at line 232 of file SVFBugReport.h.

233 {
234 return bug->getBugType() == GenericBug::FILENEVERCLOSE;
235 }

◆ getBugDescription()

cJSON * FileNeverCloseBug::getBugDescription ( ) const
virtual

Implements SVF::GenericBug.

Definition at line 207 of file SVFBugReport.cpp.

208{
209 cJSON *bugDescription = cJSON_CreateObject();
210 return bugDescription;
211}
struct cJSON cJSON

◆ printBugToTerminal()

void FileNeverCloseBug::printBugToTerminal ( ) const
virtual

Implements SVF::GenericBug.

Definition at line 213 of file SVFBugReport.cpp.

214{
215 SVFUtil::errs() << SVFUtil::bugMsg1("\t FileNeverClose :") << " file open location at : ("
216 << GenericBug::getLoc() << ")\n";
217}
const std::string getLoc() const
returns bug location as json format string
std::string bugMsg1(const std::string &msg)
Definition SVFUtil.cpp:103
std::ostream & errs()
Overwrite llvm::errs().
Definition SVFUtil.h:64

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