svf-tools 1.0.405 → 1.0.408
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/SVF-doxygen/html/html/AndersenSFR_8cpp_source.html +2 -2
- package/SVF-doxygen/html/html/CHGBuilder_8cpp_source.html +2 -2
- package/SVF-doxygen/html/html/ConsG_8h_source.html +2 -2
- package/SVF-doxygen/html/html/ContextDDA_8cpp_source.html +3 -3
- package/SVF-doxygen/html/html/DDAVFSolver_8h_source.html +6 -6
- package/SVF-doxygen/html/html/FlowDDA_8cpp_source.html +2 -2
- package/SVF-doxygen/html/html/FlowSensitiveStat_8cpp_source.html +3 -3
- package/SVF-doxygen/html/html/IRGraph_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/IRGraph_8h_source.html +16 -16
- package/SVF-doxygen/html/html/LLVMUtil_8cpp_source.html +16 -12
- package/SVF-doxygen/html/html/LLVMUtil_8h.html +3 -0
- package/SVF-doxygen/html/html/LLVMUtil_8h_source.html +20 -19
- package/SVF-doxygen/html/html/LocationSet_8cpp_source.html +4 -4
- package/SVF-doxygen/html/html/MemRegion_8cpp_source.html +6 -6
- package/SVF-doxygen/html/html/MemSSA_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/PAGBuilderFromFile_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/PTAStat_8cpp_source.html +16 -16
- package/SVF-doxygen/html/html/PathCondAllocator_8cpp_source.html +2 -2
- package/SVF-doxygen/html/html/PointerAnalysisImpl_8cpp_source.html +2 -2
- package/SVF-doxygen/html/html/PointerAnalysis_8cpp_source.html +6 -6
- package/SVF-doxygen/html/html/PointerAnalysis_8h_source.html +5 -5
- package/SVF-doxygen/html/html/SVFIRBuilder_8cpp_source.html +20 -20
- package/SVF-doxygen/html/html/SVFIR_8cpp_source.html +8 -8
- package/SVF-doxygen/html/html/SVFIR_8h_source.html +10 -10
- package/SVF-doxygen/html/html/SVFModule_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/SVFStatements_8cpp_source.html +2 -2
- package/SVF-doxygen/html/html/SVFVariables_8h_source.html +6 -6
- package/SVF-doxygen/html/html/SaberSVFGBuilder_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/SymbolTableBuilder_8cpp_source.html +50 -51
- package/SVF-doxygen/html/html/SymbolTableBuilder_8h_source.html +17 -17
- package/SVF-doxygen/html/html/SymbolTableInfo_8cpp_source.html +88 -87
- package/SVF-doxygen/html/html/SymbolTableInfo_8h_source.html +108 -109
- package/SVF-doxygen/html/html/ThreadCallGraph_8cpp_source.html +3 -3
- package/SVF-doxygen/html/html/TypeBasedHeapCloning_8cpp_source.html +3 -3
- package/SVF-doxygen/html/html/TypeBasedHeapCloning_8h_source.html +1 -1
- package/SVF-doxygen/html/html/VersionedFlowSensitiveStat_8cpp_source.html +3 -3
- package/SVF-doxygen/html/html/classSVF_1_1AndersenSFR.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1BVDataPTAImpl.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1BranchStmt.html +4 -4
- package/SVF-doxygen/html/html/classSVF_1_1CHGBuilder.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1ContextDDA.html +3 -3
- package/SVF-doxygen/html/html/classSVF_1_1DDAVFSolver.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1FlowDDA.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1FlowSensitive.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1FlowSensitiveStat.html +3 -3
- package/SVF-doxygen/html/html/classSVF_1_1GepObjVar.html +4 -4
- package/SVF-doxygen/html/html/classSVF_1_1IRGraph.html +17 -17
- package/SVF-doxygen/html/html/classSVF_1_1LocationSet.html +5 -5
- package/SVF-doxygen/html/html/classSVF_1_1MRGenerator.html +7 -7
- package/SVF-doxygen/html/html/classSVF_1_1MemObj-members.html +29 -28
- package/SVF-doxygen/html/html/classSVF_1_1MemObj.html +110 -88
- package/SVF-doxygen/html/html/classSVF_1_1MemSSA.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1ObjTypeInfo-members.html +13 -10
- package/SVF-doxygen/html/html/classSVF_1_1ObjTypeInfo.html +189 -91
- package/SVF-doxygen/html/html/classSVF_1_1ObjVar.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1PAGBuilderFromFile.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1PTAStat.html +17 -17
- package/SVF-doxygen/html/html/classSVF_1_1PathCondAllocator.html +6 -6
- package/SVF-doxygen/html/html/classSVF_1_1PointerAnalysis.html +9 -9
- package/SVF-doxygen/html/html/classSVF_1_1SVFIR.html +22 -22
- package/SVF-doxygen/html/html/classSVF_1_1SVFIRBuilder.html +32 -32
- package/SVF-doxygen/html/html/classSVF_1_1SVFModule.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1SVFVar.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1SaberSVFGBuilder.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1StInfo-members.html +10 -13
- package/SVF-doxygen/html/html/classSVF_1_1StInfo.html +26 -123
- package/SVF-doxygen/html/html/classSVF_1_1SymbolTableBuilder-members.html +7 -8
- package/SVF-doxygen/html/html/classSVF_1_1SymbolTableBuilder.html +109 -138
- package/SVF-doxygen/html/html/classSVF_1_1SymbolTableInfo-members.html +34 -35
- package/SVF-doxygen/html/html/classSVF_1_1SymbolTableInfo.html +172 -201
- package/SVF-doxygen/html/html/classSVF_1_1ThreadCallGraph.html +3 -3
- package/SVF-doxygen/html/html/classSVF_1_1TypeBasedHeapCloning.html +4 -4
- package/SVF-doxygen/html/html/classSVF_1_1VersionedFlowSensitiveStat.html +3 -3
- package/SVF-doxygen/html/html/dda_8cpp.html +1 -1
- package/SVF-doxygen/html/html/dda_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/functions_e.html +3 -0
- package/SVF-doxygen/html/html/functions_func_g.html +16 -18
- package/SVF-doxygen/html/html/functions_func_s.html +3 -3
- package/SVF-doxygen/html/html/functions_g.html +14 -16
- package/SVF-doxygen/html/html/functions_i.html +4 -4
- package/SVF-doxygen/html/html/functions_l.html +5 -5
- package/SVF-doxygen/html/html/functions_m.html +1 -5
- package/SVF-doxygen/html/html/functions_o.html +9 -9
- package/SVF-doxygen/html/html/functions_p.html +9 -9
- package/SVF-doxygen/html/html/functions_r.html +1 -1
- package/SVF-doxygen/html/html/functions_s.html +10 -12
- package/SVF-doxygen/html/html/functions_t.html +10 -8
- package/SVF-doxygen/html/html/functions_v.html +3 -3
- package/SVF-doxygen/html/html/functions_vars_e.html +3 -0
- package/SVF-doxygen/html/html/functions_vars_m.html +0 -4
- package/SVF-doxygen/html/html/functions_w.html +9 -5
- package/SVF-doxygen/html/html/globals_r.html +3 -3
- package/SVF-doxygen/html/html/globals_s.html +5 -7
- package/SVF-doxygen/html/html/mta_8cpp.html +1 -1
- package/SVF-doxygen/html/html/mta_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/namespaceSVF_1_1SVFUtil.html +73 -41
- package/SVF-doxygen/html/html/namespacemembers_func.html +4 -1
- package/SVF-doxygen/html/html/namespacemembers_g.html +3 -0
- package/SVF-doxygen/html/html/saber_8cpp.html +1 -1
- package/SVF-doxygen/html/html/saber_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/search/all_10.js +7 -7
- package/SVF-doxygen/html/html/search/all_12.js +2 -2
- package/SVF-doxygen/html/html/search/all_13.js +8 -8
- package/SVF-doxygen/html/html/search/all_14.js +7 -7
- package/SVF-doxygen/html/html/search/all_15.js +1 -1
- package/SVF-doxygen/html/html/search/all_16.js +1 -1
- package/SVF-doxygen/html/html/search/all_17.js +1 -1
- package/SVF-doxygen/html/html/search/all_5.js +1 -0
- package/SVF-doxygen/html/html/search/all_7.js +3 -3
- package/SVF-doxygen/html/html/search/all_9.js +2 -2
- package/SVF-doxygen/html/html/search/all_c.js +3 -3
- package/SVF-doxygen/html/html/search/all_d.js +2 -2
- package/SVF-doxygen/html/html/search/all_e.js +4 -4
- package/SVF-doxygen/html/html/search/all_f.js +1 -1
- package/SVF-doxygen/html/html/search/functions_10.js +2 -2
- package/SVF-doxygen/html/html/search/functions_6.js +3 -3
- package/SVF-doxygen/html/html/search/functions_8.js +1 -1
- package/SVF-doxygen/html/html/search/functions_e.js +1 -1
- package/SVF-doxygen/html/html/search/variables_14.js +3 -3
- package/SVF-doxygen/html/html/search/variables_15.js +1 -1
- package/SVF-doxygen/html/html/search/variables_5.js +1 -0
- package/SVF-doxygen/html/html/search/variables_d.js +1 -1
- package/SVF-doxygen/html/html/search/variables_e.js +3 -3
- package/SVF-doxygen/html/html/svf-ex_8cpp.html +1 -1
- package/SVF-doxygen/html/html/svf-ex_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/wpa_8cpp.html +1 -1
- package/SVF-doxygen/html/html/wpa_8cpp_source.html +1 -1
- package/include/MemoryModel/SymbolTableInfo.h +18 -14
- package/include/SVF-FE/LLVMUtil.h +3 -0
- package/include/SVF-FE/SymbolTableBuilder.h +1 -3
- package/lib/MemoryModel/SVFIR.cpp +1 -1
- package/lib/MemoryModel/SymbolTableInfo.cpp +9 -15
- package/lib/SVF-FE/LLVMUtil.cpp +21 -4
- package/lib/SVF-FE/SymbolTableBuilder.cpp +17 -32
- package/package.json +1 -1
package/lib/SVF-FE/LLVMUtil.cpp
CHANGED
|
@@ -263,6 +263,23 @@ void SVFUtil::getPrevInsts(const Instruction* curInst, std::vector<const Instruc
|
|
|
263
263
|
}
|
|
264
264
|
}
|
|
265
265
|
|
|
266
|
+
/*
|
|
267
|
+
* Get the first dominated cast instruction for heap allocations since they typically come from void* (i8*)
|
|
268
|
+
* for example, %4 = call align 16 i8* @malloc(i64 10); %5 = bitcast i8* %4 to i32*
|
|
269
|
+
* return %5 whose type is i32* but not %4 whose type is i8*
|
|
270
|
+
*/
|
|
271
|
+
const Value* SVFUtil::getUniqueUseViaCastInst(const Value* val){
|
|
272
|
+
const PointerType * type = SVFUtil::dyn_cast<PointerType>(val->getType());
|
|
273
|
+
assert(type && "this value should be a pointer type!");
|
|
274
|
+
/// If type is void* (i8*) and val is only used at a bitcast instruction
|
|
275
|
+
if (IntegerType *IT = SVFUtil::dyn_cast<IntegerType>(type->getPointerElementType())){
|
|
276
|
+
if (IT->getBitWidth() == 8 && val->getNumUses()==1){
|
|
277
|
+
const Use *u = &*val->use_begin();
|
|
278
|
+
return SVFUtil::dyn_cast<BitCastInst>(u->getUser());
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
return nullptr;
|
|
282
|
+
}
|
|
266
283
|
|
|
267
284
|
/*!
|
|
268
285
|
* Return the type of the object from a heap allocation
|
|
@@ -273,10 +290,10 @@ const Type* SVFUtil::getTypeOfHeapAlloc(const Instruction *inst)
|
|
|
273
290
|
|
|
274
291
|
if(isHeapAllocExtCallViaRet(inst))
|
|
275
292
|
{
|
|
276
|
-
const
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
293
|
+
if(const Value* v = getUniqueUseViaCastInst(inst)){
|
|
294
|
+
if(const PointerType* newTy = SVFUtil::dyn_cast<PointerType>(v->getType()))
|
|
295
|
+
type = newTy;
|
|
296
|
+
}
|
|
280
297
|
}
|
|
281
298
|
else if(isHeapAllocExtCallViaArg(inst))
|
|
282
299
|
{
|
|
@@ -51,8 +51,6 @@ void SymbolTableBuilder::buildMemModel(SVFModule* svfModule)
|
|
|
51
51
|
|
|
52
52
|
symInfo->setModule(svfModule);
|
|
53
53
|
|
|
54
|
-
StInfo::setMaxFieldLimit(Options::MaxFieldLimit);
|
|
55
|
-
|
|
56
54
|
// Pointer #0 always represents the null pointer.
|
|
57
55
|
assert(symInfo->totalSymNum++ == SymbolTableInfo::NullPtr && "Something changed!");
|
|
58
56
|
|
|
@@ -586,24 +584,6 @@ void SymbolTableBuilder::analyzeStaticObjType(ObjTypeInfo* typeinfo, const Value
|
|
|
586
584
|
}
|
|
587
585
|
}
|
|
588
586
|
|
|
589
|
-
/*
|
|
590
|
-
* Get the first dominated cast instruction for heap allocations since they typically come from void* (i8*)
|
|
591
|
-
* for example, %4 = call align 16 i8* @malloc(i64 10); %5 = bitcast i8* %4 to i32*
|
|
592
|
-
* return %5 whose type is i32* but not %4 whose type is i8*
|
|
593
|
-
*/
|
|
594
|
-
const Value* SymbolTableBuilder::getUniqueUseViaCastInst(const Value* val){
|
|
595
|
-
const PointerType * type = SVFUtil::dyn_cast<PointerType>(val->getType());
|
|
596
|
-
assert(type && "this value should be a pointer type!");
|
|
597
|
-
/// If type is void* (i8*) and val is only used at a bitcast instruction
|
|
598
|
-
if (IntegerType *IT = SVFUtil::dyn_cast<IntegerType>(type->getPointerElementType())){
|
|
599
|
-
if (IT->getBitWidth() == 8 && val->getNumUses()==1){
|
|
600
|
-
const Use *u = &*val->use_begin();
|
|
601
|
-
return SVFUtil::dyn_cast<BitCastInst>(u->getUser());
|
|
602
|
-
}
|
|
603
|
-
}
|
|
604
|
-
return nullptr;
|
|
605
|
-
}
|
|
606
|
-
|
|
607
587
|
/*!
|
|
608
588
|
* Initialize the type info of an object
|
|
609
589
|
*/
|
|
@@ -615,13 +595,18 @@ void SymbolTableBuilder::initTypeInfo(ObjTypeInfo* typeinfo, const Value* val){
|
|
|
615
595
|
{
|
|
616
596
|
typeinfo->setFlag(ObjTypeInfo::FUNCTION_OBJ);
|
|
617
597
|
analyzeObjType(typeinfo,val);
|
|
618
|
-
objSize = getObjSize(
|
|
598
|
+
objSize = getObjSize(typeinfo->getType());
|
|
619
599
|
}
|
|
620
|
-
else if(SVFUtil::
|
|
600
|
+
else if(const AllocaInst* allocaInst = SVFUtil::dyn_cast<AllocaInst>(val))
|
|
621
601
|
{
|
|
622
602
|
typeinfo->setFlag(ObjTypeInfo::STACK_OBJ);
|
|
623
603
|
analyzeObjType(typeinfo,val);
|
|
624
|
-
|
|
604
|
+
/// This is for `alloca <ty> <NumElements>`. For example, `alloca i64 3` allocates 3 i64 on the stack (objSize=3)
|
|
605
|
+
/// In most cases, `NumElements` is not specified in the instruction, which means there is only one element (objSize=1).
|
|
606
|
+
if(const ConstantInt *sz = SVFUtil::dyn_cast<ConstantInt>(allocaInst->getArraySize()))
|
|
607
|
+
objSize = sz->getZExtValue() * getObjSize(typeinfo->getType());
|
|
608
|
+
else
|
|
609
|
+
objSize = getObjSize(typeinfo->getType());
|
|
625
610
|
}
|
|
626
611
|
else if(SVFUtil::isa<GlobalVariable>(val))
|
|
627
612
|
{
|
|
@@ -629,29 +614,30 @@ void SymbolTableBuilder::initTypeInfo(ObjTypeInfo* typeinfo, const Value* val){
|
|
|
629
614
|
if(SymbolTableInfo::SymbolInfo()->isConstantObjSym(val))
|
|
630
615
|
typeinfo->setFlag(ObjTypeInfo::CONST_GLOBAL_OBJ);
|
|
631
616
|
analyzeObjType(typeinfo,val);
|
|
632
|
-
objSize = getObjSize(
|
|
617
|
+
objSize = getObjSize(typeinfo->getType());
|
|
633
618
|
}
|
|
634
619
|
else if (SVFUtil::isa<Instruction>(val) && isHeapAllocExtCall(SVFUtil::cast<Instruction>(val)))
|
|
635
620
|
{
|
|
636
621
|
analyzeHeapObjType(typeinfo,val);
|
|
637
622
|
// Heap object, label its field as infinite here
|
|
638
|
-
objSize =
|
|
623
|
+
objSize = typeinfo->getMaxFieldOffsetLimit();
|
|
639
624
|
}
|
|
640
625
|
else if (SVFUtil::isa<Instruction>(val) && isStaticExtCall(SVFUtil::cast<Instruction>(val)))
|
|
641
626
|
{
|
|
642
627
|
analyzeStaticObjType(typeinfo,val);
|
|
643
628
|
// static object allocated before main, label its field as infinite here
|
|
644
|
-
objSize =
|
|
629
|
+
objSize = typeinfo->getMaxFieldOffsetLimit();
|
|
645
630
|
}
|
|
646
631
|
else if(ArgInProgEntryFunction(val))
|
|
647
632
|
{
|
|
648
633
|
analyzeStaticObjType(typeinfo,val);
|
|
649
634
|
// user input data, label its field as infinite here
|
|
650
|
-
objSize =
|
|
635
|
+
objSize = typeinfo->getMaxFieldOffsetLimit();
|
|
651
636
|
}
|
|
652
637
|
else if(SVFUtil::isConstantData(val))
|
|
653
638
|
{
|
|
654
639
|
typeinfo->setFlag(ObjTypeInfo::CONST_DATA);
|
|
640
|
+
objSize = SymbolTableInfo::SymbolInfo()->getNumOfFlattenElements(val->getType());
|
|
655
641
|
}
|
|
656
642
|
else{
|
|
657
643
|
assert("what other object do we have??");
|
|
@@ -659,17 +645,16 @@ void SymbolTableBuilder::initTypeInfo(ObjTypeInfo* typeinfo, const Value* val){
|
|
|
659
645
|
}
|
|
660
646
|
|
|
661
647
|
// Reset maxOffsetLimit if it is over the total fieldNum of this object
|
|
662
|
-
if(
|
|
663
|
-
typeinfo->
|
|
648
|
+
if(typeinfo->getMaxFieldOffsetLimit() > objSize)
|
|
649
|
+
typeinfo->setNumOfElements(objSize);
|
|
664
650
|
}
|
|
665
651
|
|
|
666
652
|
/*!
|
|
667
653
|
* Return size of this Object
|
|
668
654
|
*/
|
|
669
|
-
u32_t SymbolTableBuilder::getObjSize(const
|
|
655
|
+
u32_t SymbolTableBuilder::getObjSize(const Type* ety)
|
|
670
656
|
{
|
|
671
|
-
|
|
672
|
-
Type* ety = SVFUtil::cast<PointerType>(val->getType())->getElementType();
|
|
657
|
+
assert(ety && "type is null?");
|
|
673
658
|
u32_t numOfFields = 1;
|
|
674
659
|
if (SVFUtil::isa<StructType>(ety) || SVFUtil::isa<ArrayType>(ety))
|
|
675
660
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "svf-tools",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.408",
|
|
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": {
|