svf-tools 1.0.1247 → 1.0.1249
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/svf/include/Util/Options.h +1 -1
- package/svf/lib/AE/Svfexe/AbstractInterpretation.cpp +1 -1
- package/svf/lib/MTA/MHP.cpp +1 -1
- package/svf/lib/Util/Options.cpp +1 -1
- package/svf/lib/Util/SVFUtil.cpp +2 -1
- package/svf-llvm/include/SVF-LLVM/LLVMUtil.h +3 -1
- package/svf-llvm/lib/LLVMModule.cpp +5 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "svf-tools",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1249",
|
|
4
4
|
"description": "* <b>[TypeClone](https://github.com/SVF-tools/SVF/wiki/TypeClone) published in our [ECOOP paper](https://yuleisui.github.io/publications/ecoop20.pdf) is now available in SVF </b> * <b>SVF now uses a single script for its build. Just type [`source ./build.sh`](https://github.com/SVF-tools/SVF/blob/master/build.sh) in your terminal, that's it!</b> * <b>SVF now supports LLVM-10.0.0! </b> * <b>We thank [bsauce](https://github.com/bsauce) for writing a user manual of SVF ([link1](https://www.jianshu.com/p/068a08ec749c) and [link2](https://www.jianshu.com/p/777c30d4240e)) in Chinese </b> * <b>SVF now supports LLVM-9.0.0 (Thank [Byoungyoung Lee](https://github.com/SVF-tools/SVF/issues/142) for his help!). </b> * <b>SVF now supports a set of [field-sensitive pointer analyses](https://yuleisui.github.io/publications/sas2019a.pdf). </b> * <b>[Use SVF as an external lib](https://github.com/SVF-tools/SVF/wiki/Using-SVF-as-a-lib-in-your-own-tool) for your own project (Contributed by [Hongxu Chen](https://github.com/HongxuChen)). </b> * <b>SVF now supports LLVM-7.0.0. </b> * <b>SVF now supports Docker. [Try SVF in Docker](https://github.com/SVF-tools/SVF/wiki/Try-SVF-in-Docker)! </b> * <b>SVF now supports [LLVM-6.0.0](https://github.com/svf-tools/SVF/pull/38) (Contributed by [Jack Anthony](https://github.com/jackanth)). </b> * <b>SVF now supports [LLVM-4.0.0](https://github.com/svf-tools/SVF/pull/23) (Contributed by Jared Carlson. Thank [Jared](https://github.com/jcarlson23) and [Will](https://github.com/dtzWill) for their in-depth [discussions](https://github.com/svf-tools/SVF/pull/18) about updating SVF!) </b> * <b>SVF now supports analysis for C++ programs.</b> <br />",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -125,7 +125,7 @@ std::deque<const FunObjVar*> AbstractInterpretation::collectProgEntryFuns()
|
|
|
125
125
|
if (cgNode->getInEdges().empty())
|
|
126
126
|
{
|
|
127
127
|
// If main exists, put it first for priority using deque's push_front
|
|
128
|
-
if (fun
|
|
128
|
+
if (SVFUtil::isProgEntryFunction(fun))
|
|
129
129
|
{
|
|
130
130
|
entryFunctions.push_front(fun);
|
|
131
131
|
}
|
package/svf/lib/MTA/MHP.cpp
CHANGED
|
@@ -567,7 +567,7 @@ bool MHP::isConnectedfromMain(const FunObjVar* fun)
|
|
|
567
567
|
while (!worklist.empty())
|
|
568
568
|
{
|
|
569
569
|
const CallGraphNode* node = worklist.pop();
|
|
570
|
-
if (
|
|
570
|
+
if (SVFUtil::isProgEntryFunction(node->getFunction()))
|
|
571
571
|
return true;
|
|
572
572
|
for (CallGraphNode::const_iterator nit = node->InEdgeBegin(), neit = node->InEdgeEnd(); nit != neit; nit++)
|
|
573
573
|
{
|
package/svf/lib/Util/Options.cpp
CHANGED
package/svf/lib/Util/SVFUtil.cpp
CHANGED
|
@@ -441,5 +441,6 @@ bool SVFUtil::isExtCall(const FunObjVar* fun)
|
|
|
441
441
|
|
|
442
442
|
bool SVFUtil::isProgEntryFunction(const FunObjVar* funObjVar)
|
|
443
443
|
{
|
|
444
|
-
|
|
444
|
+
const char* main_name=Options::SVFMain() ? "svf.main" : "main";
|
|
445
|
+
return funObjVar && funObjVar->getName() == main_name;
|
|
445
446
|
}
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
#include "Util/SVFUtil.h"
|
|
34
34
|
#include "SVF-LLVM/BasicTypes.h"
|
|
35
35
|
#include "Util/ThreadAPI.h"
|
|
36
|
+
#include "Util/Options.h"
|
|
36
37
|
|
|
37
38
|
namespace SVF
|
|
38
39
|
{
|
|
@@ -112,7 +113,8 @@ const Function* getProgFunction(const std::string& funName);
|
|
|
112
113
|
/// Check whether a function is an entry function (i.e., main)
|
|
113
114
|
inline bool isProgEntryFunction(const Function* fun)
|
|
114
115
|
{
|
|
115
|
-
|
|
116
|
+
const char* main_name=Options::SVFMain() ? "svf.main" : "main";
|
|
117
|
+
return fun && fun->getName() == main_name;
|
|
116
118
|
}
|
|
117
119
|
|
|
118
120
|
/// Check whether this value is a black hole
|
|
@@ -598,6 +598,11 @@ void LLVMModuleSet::addSVFMain()
|
|
|
598
598
|
// return;
|
|
599
599
|
Builder.CreateRetVoid();
|
|
600
600
|
}
|
|
601
|
+
else
|
|
602
|
+
{
|
|
603
|
+
// use SVF::Options to record whether svf.main is added or not
|
|
604
|
+
Options::SVFMain.setValue(false);
|
|
605
|
+
}
|
|
601
606
|
}
|
|
602
607
|
|
|
603
608
|
void LLVMModuleSet::collectExtFunAnnotations(const Module* mod)
|