Static Value-Flow Analysis
FileChecker.h
Go to the documentation of this file.
1 //===- FileChecker.h -- Checking incorrect file-open close errors-------------//
2 //
3 // SVF: Static Value-Flow Analysis
4 //
5 // Copyright (C) <2013-> <Yulei Sui>
6 //
7 
8 // This program is free software: you can redistribute it and/or modify
9 // it under the terms of the GNU Affero General Public License as published by
10 // the Free Software Foundation, either version 3 of the License, or
11 // (at your option) any later version.
12 
13 // This program is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU Affero General Public License for more details.
17 
18 // You should have received a copy of the GNU Affero General Public License
19 // along with this program. If not, see <http://www.gnu.org/licenses/>.
20 //
21 //===----------------------------------------------------------------------===//
22 
23 /*
24  * FileChecker.h
25  *
26  * Created on: Apr 24, 2014
27  * Author: Yulei Sui
28  */
29 
30 #ifndef FILECHECK_H_
31 #define FILECHECK_H_
32 
33 #include "SABER/LeakChecker.h"
34 
35 namespace SVF
36 {
37 
42 class FileChecker : public LeakChecker
43 {
44 
45 public:
46 
49  {
50  }
51 
53  virtual ~FileChecker()
54  {
55  }
56 
58  virtual bool runOnModule(SVFIR* pag)
59  {
61  analyze(pag->getModule());
62  return false;
63  }
64 
65  inline bool isSourceLikeFun(const SVFFunction* fun)
66  {
68  }
70  inline bool isSinkLikeFun(const SVFFunction* fun)
71  {
73  }
75  void reportBug(ProgSlice* slice);
76 };
77 
78 } // End namespace SVF
79 
80 #endif /* FILECHECK_H_ */
FileChecker()
Constructor.
Definition: FileChecker.h:48
virtual bool runOnModule(SVFIR *pag)
We start from here.
Definition: FileChecker.h:58
void reportBug(ProgSlice *slice)
Report file/close bugs.
Definition: FileChecker.cpp:36
bool isSinkLikeFun(const SVFFunction *fun)
Whether the function is a heap deallocator (free/release memory)
Definition: FileChecker.h:70
virtual ~FileChecker()
Destructor.
Definition: FileChecker.h:53
bool isSourceLikeFun(const SVFFunction *fun)
Whether the function is a heap allocator/reallocator (allocate memory)
Definition: FileChecker.h:65
SVFModule * getModule()
Definition: SVFIR.h:161
bool isFOpen(const SVFFunction *fun) const
Return true if this call is a file open.
bool isFClose(const SVFFunction *fun) const
Return true if this call is a file close.
static SaberCheckerAPI * getCheckerAPI()
Return a static reference.
virtual void analyze(SVFModule *module)
Start analysis here.
Definition: SrcSnkDDA.cpp:61
for isBitcode
Definition: BasicTypes.h:68