Static Value-Flow Analysis
Public Member Functions | Static Public Member Functions | List of all members
SVF::FileNeverCloseBug Class Reference

#include <SVFBugReport.h>

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

Public Member Functions

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

Static Public Member Functions

static bool classof (const GenericBug *bug)
 ClassOf. More...
 

Additional Inherited Members

- Public Types inherited from SVF::GenericBug
enum  BugType {
  FULLBUFOVERFLOW , PARTIALBUFOVERFLOW , NEVERFREE , PARTIALLEAK ,
  DOUBLEFREE , FILENEVERCLOSE , FILEPARTIALCLOSE , FULLNULLPTRDEREFERENCE ,
  PARTIALNULLPTRDEREFERENCE
}
 
typedef std::vector< SVFBugEventEventStack
 
- Static Public Attributes inherited from SVF::GenericBug
static const std::map< GenericBug::BugType, std::stringBugType2Str
 
- Protected Attributes inherited from SVF::GenericBug
BugType bugType
 
const EventStack bugEventStack
 

Detailed Description

Definition at line 224 of file SVFBugReport.h.

Constructor & Destructor Documentation

◆ FileNeverCloseBug()

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

Definition at line 227 of file SVFBugReport.h.

227  :
GenericBug(BugType bugType, const EventStack &bugEventStack)
note: should be initialized with a bugEventStack
Definition: SVFBugReport.h:95
const EventStack bugEventStack
Definition: SVFBugReport.h:91

Member Function Documentation

◆ classof()

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

ClassOf.

Definition at line 234 of file SVFBugReport.h.

235  {
236  return bug->getBugType() == GenericBug::FILENEVERCLOSE;
237  }

◆ getBugDescription()

cJSON * FileNeverCloseBug::getBugDescription ( ) const
virtual

Implements SVF::GenericBug.

Definition at line 203 of file SVFBugReport.cpp.

204 {
205  cJSON *bugDescription = cJSON_CreateObject();
206  return bugDescription;
207 }
Definition: cJSON.h:104

◆ printBugToTerminal()

void FileNeverCloseBug::printBugToTerminal ( ) const
virtual

Implements SVF::GenericBug.

Definition at line 209 of file SVFBugReport.cpp.

210 {
211  SVFUtil::errs() << SVFUtil::bugMsg1("\t FileNeverClose :") << " file open location at : ("
212  << GenericBug::getLoc() << ")\n";
213 }
const std::string getLoc() const
returns bug location as json format string
std::string bugMsg1(const std::string &msg)
Definition: SVFUtil.cpp:81
std::ostream & errs()
Overwrite llvm::errs()
Definition: SVFUtil.h:56

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