svf-tools 1.0.670 → 1.0.671
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "svf-tools",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.671",
|
|
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": {
|
|
@@ -42,6 +42,7 @@ class SVFIR2ItvExeState
|
|
|
42
42
|
{
|
|
43
43
|
public:
|
|
44
44
|
typedef ExeState::VAddrs VAddrs;
|
|
45
|
+
static VAddrs globalNullVaddrs;
|
|
45
46
|
public:
|
|
46
47
|
SVFIR2ItvExeState(SVFIR *ir) : _svfir(ir) {}
|
|
47
48
|
|
|
@@ -89,7 +90,10 @@ public:
|
|
|
89
90
|
|
|
90
91
|
inline VAddrs &getVAddrs(u32_t id)
|
|
91
92
|
{
|
|
92
|
-
|
|
93
|
+
if (inVarToAddrsTable(id))
|
|
94
|
+
return _es.getVAddrs(id);
|
|
95
|
+
else
|
|
96
|
+
return globalNullVaddrs;
|
|
93
97
|
}
|
|
94
98
|
|
|
95
99
|
inline bool inVarToIValTable(u32_t id) const
|
|
@@ -127,7 +127,7 @@ std::pair<s32_t, s32_t> SVFIR2ItvExeState::getGepOffset(const GepStmt *gep)
|
|
|
127
127
|
u32_t idx = _svfir->getValueNode(value);
|
|
128
128
|
if (!inVarToIValTable(idx)) return std::make_pair(-1, -1);
|
|
129
129
|
IntervalValue &idxVal = _es[idx];
|
|
130
|
-
if(idxVal.isBottom() || idxVal.isTop()) return std::make_pair(
|
|
130
|
+
if(idxVal.isBottom() || idxVal.isTop()) return std::make_pair(0, (s32_t)Options::MaxFieldLimit());
|
|
131
131
|
if (idxVal.is_numeral())
|
|
132
132
|
{
|
|
133
133
|
offsetLb = offsetUb = idxVal.lb().getNumeral();
|
|
@@ -552,7 +552,7 @@ void SVFIR2ItvExeState::translateLoad(const LoadStmt *load)
|
|
|
552
552
|
if (inVarToAddrsTable(rhs))
|
|
553
553
|
{
|
|
554
554
|
VAddrs &addrs = getVAddrs(rhs);
|
|
555
|
-
assert(!
|
|
555
|
+
assert(!addrs.empty());
|
|
556
556
|
for (const auto &addr: addrs)
|
|
557
557
|
{
|
|
558
558
|
u32_t objId = getInternalID(addr);
|
|
@@ -637,7 +637,7 @@ void SVFIR2ItvExeState::translateCopy(const CopyStmt *copy)
|
|
|
637
637
|
else if (inVarToAddrsTable(rhs))
|
|
638
638
|
{
|
|
639
639
|
assert(!getVAddrs(rhs).empty());
|
|
640
|
-
getVAddrs(lhs) = getVAddrs(rhs);
|
|
640
|
+
getEs().getVAddrs(lhs) = getVAddrs(rhs);
|
|
641
641
|
}
|
|
642
642
|
}
|
|
643
643
|
}
|
|
@@ -646,8 +646,6 @@ void SVFIR2ItvExeState::translateGep(const GepStmt *gep)
|
|
|
646
646
|
{
|
|
647
647
|
u32_t rhs = gep->getRHSVarID();
|
|
648
648
|
u32_t lhs = gep->getLHSVarID();
|
|
649
|
-
if (!inVarToAddrsTable(rhs)) return;
|
|
650
|
-
assert(!getVAddrs(rhs).empty());
|
|
651
649
|
VAddrs &rhsVal = getVAddrs(rhs);
|
|
652
650
|
if (rhsVal.empty()) return;
|
|
653
651
|
std::pair<s32_t, s32_t> offsetPair = getGepOffset(gep);
|
|
@@ -668,7 +666,7 @@ void SVFIR2ItvExeState::translateGep(const GepStmt *gep)
|
|
|
668
666
|
{
|
|
669
667
|
gepAddrs.join_with(getGepObjAddress(rhs, i));
|
|
670
668
|
}
|
|
671
|
-
getVAddrs(lhs) = gepAddrs;
|
|
669
|
+
getEs().getVAddrs(lhs) = gepAddrs;
|
|
672
670
|
return;
|
|
673
671
|
}
|
|
674
672
|
}
|
|
@@ -696,7 +694,7 @@ void SVFIR2ItvExeState::translateSelect(const SelectStmt *select)
|
|
|
696
694
|
{
|
|
697
695
|
assert(!getVAddrs(fval).empty());
|
|
698
696
|
assert(!getVAddrs(tval).empty());
|
|
699
|
-
getVAddrs(res) = _es[cond].is_zero() ? getVAddrs(fval) : getVAddrs(tval);
|
|
697
|
+
getEs().getVAddrs(res) = _es[cond].is_zero() ? getVAddrs(fval) : getVAddrs(tval);
|
|
700
698
|
}
|
|
701
699
|
}
|
|
702
700
|
}
|
|
@@ -725,7 +723,7 @@ void SVFIR2ItvExeState::translatePhi(const PhiStmt *phi)
|
|
|
725
723
|
const VAddrs &cur = getVAddrs(curId);
|
|
726
724
|
if (!inVarToAddrsTable(res))
|
|
727
725
|
{
|
|
728
|
-
getVAddrs(res) = cur;
|
|
726
|
+
getEs().getVAddrs(res) = cur;
|
|
729
727
|
}
|
|
730
728
|
else
|
|
731
729
|
{
|
|
@@ -747,7 +745,7 @@ void SVFIR2ItvExeState::translateCall(const CallPE *callPE)
|
|
|
747
745
|
else if (inVarToAddrsTable(rhs))
|
|
748
746
|
{
|
|
749
747
|
assert(!getVAddrs(rhs).empty());
|
|
750
|
-
getVAddrs(lhs) = getVAddrs(rhs);
|
|
748
|
+
getEs().getVAddrs(lhs) = getVAddrs(rhs);
|
|
751
749
|
}
|
|
752
750
|
}
|
|
753
751
|
|
|
@@ -762,6 +760,6 @@ void SVFIR2ItvExeState::translateRet(const RetPE *retPE)
|
|
|
762
760
|
else if (inVarToAddrsTable(rhs))
|
|
763
761
|
{
|
|
764
762
|
assert(!getVAddrs(rhs).empty());
|
|
765
|
-
getVAddrs(lhs) = getVAddrs(rhs);
|
|
763
|
+
getEs().getVAddrs(lhs) = getVAddrs(rhs);
|
|
766
764
|
}
|
|
767
765
|
}
|