svf-lib 1.0.1810 → 1.0.1812
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-linux/Release-build/svf/libSvfCore.a +0 -0
- package/SVF-linux/svf/include/AbstractExecution/IntervalExeState.h +2 -2
- package/SVF-osx/Release-build/svf/libSvfCore.a +0 -0
- package/SVF-osx/Release-build/svf-llvm/libSvfLLVM.a +0 -0
- package/SVF-osx/svf/include/SVFIR/SVFStatements.h +13 -0
- package/SVF-osx/svf-llvm/include/SVF-LLVM/SVFIRBuilder.h +60 -0
- package/package.json +1 -1
|
Binary file
|
|
@@ -289,7 +289,7 @@ public:
|
|
|
289
289
|
}
|
|
290
290
|
}
|
|
291
291
|
|
|
292
|
-
inline virtual IntervalValue&
|
|
292
|
+
inline virtual IntervalValue& getLocVal(u32_t id)
|
|
293
293
|
{
|
|
294
294
|
auto it = _locToItvVal.find(id);
|
|
295
295
|
if(it != _locToItvVal.end())
|
|
@@ -578,7 +578,7 @@ public:
|
|
|
578
578
|
}
|
|
579
579
|
}
|
|
580
580
|
|
|
581
|
-
inline IntervalValue&
|
|
581
|
+
inline IntervalValue& getLocVal(u32_t id) override
|
|
582
582
|
{
|
|
583
583
|
auto it = _locToItvVal.find(id);
|
|
584
584
|
if(it != _locToItvVal.end())
|
|
Binary file
|
|
Binary file
|
|
@@ -320,6 +320,8 @@ private:
|
|
|
320
320
|
AddrStmt(const AddrStmt&); ///< place holder
|
|
321
321
|
void operator=(const AddrStmt&); ///< place holder
|
|
322
322
|
|
|
323
|
+
std::vector<SVFValue*> arrSize; ///< Array size of the allocated memory
|
|
324
|
+
|
|
323
325
|
public:
|
|
324
326
|
/// Methods for support type inquiry through isa, cast, and dyn_cast:
|
|
325
327
|
//@{
|
|
@@ -342,6 +344,17 @@ public:
|
|
|
342
344
|
|
|
343
345
|
virtual const std::string toString() const override;
|
|
344
346
|
|
|
347
|
+
inline void addArrSize(SVFValue* size) //TODO:addSizeVar
|
|
348
|
+
{
|
|
349
|
+
arrSize.push_back(size);
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
///< get array size of the allocated memory
|
|
353
|
+
inline const std::vector<SVFValue*>& getArrSize() const //TODO:getSizeVars
|
|
354
|
+
{
|
|
355
|
+
return arrSize;
|
|
356
|
+
}
|
|
357
|
+
|
|
345
358
|
};
|
|
346
359
|
|
|
347
360
|
/*!
|
|
@@ -297,6 +297,66 @@ protected:
|
|
|
297
297
|
}
|
|
298
298
|
return nullptr;
|
|
299
299
|
}
|
|
300
|
+
|
|
301
|
+
/// Add Address edge from allocinst with arraysize like "%4 = alloca i8, i64 3"
|
|
302
|
+
inline AddrStmt* addAddrWithStackArraySz(NodeID src, NodeID dst, llvm::AllocaInst& inst)
|
|
303
|
+
{
|
|
304
|
+
AddrStmt* edge = addAddrEdge(src, dst);
|
|
305
|
+
if (inst.getArraySize())
|
|
306
|
+
{
|
|
307
|
+
SVFValue* arrSz = LLVMModuleSet::getLLVMModuleSet()->getSVFValue(inst.getArraySize());
|
|
308
|
+
edge->addArrSize(arrSz);
|
|
309
|
+
}
|
|
310
|
+
return edge;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
/// Add Address edge from ext call with args like "%5 = call i8* @malloc(i64 noundef 5)"
|
|
314
|
+
inline AddrStmt* addAddrWithHeapSz(NodeID src, NodeID dst, const CallBase* cs)
|
|
315
|
+
{
|
|
316
|
+
// get name of called function
|
|
317
|
+
AddrStmt* edge = addAddrEdge(src, dst);
|
|
318
|
+
|
|
319
|
+
llvm::Function* calledFunc = cs->getCalledFunction();
|
|
320
|
+
std::string functionName;
|
|
321
|
+
if (calledFunc)
|
|
322
|
+
{
|
|
323
|
+
functionName = calledFunc->getName().str();
|
|
324
|
+
}
|
|
325
|
+
else
|
|
326
|
+
{
|
|
327
|
+
SVFUtil::wrnMsg("not support indirect call to add AddrStmt.\n");
|
|
328
|
+
}
|
|
329
|
+
if (functionName == "malloc")
|
|
330
|
+
{
|
|
331
|
+
if (cs->arg_size() > 0)
|
|
332
|
+
{
|
|
333
|
+
const llvm::Value* val = cs->getArgOperand(0);
|
|
334
|
+
SVFValue* svfval = LLVMModuleSet::getLLVMModuleSet()->getSVFValue(val);
|
|
335
|
+
edge->addArrSize(svfval);
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
// Check if the function called is 'calloc' and process its arguments.
|
|
339
|
+
// e.g. "%5 = call i8* @calloc(1, 8)", edge should add two SVFValue (1 and 8)
|
|
340
|
+
else if (functionName == "calloc")
|
|
341
|
+
{
|
|
342
|
+
if (cs->arg_size() > 1)
|
|
343
|
+
{
|
|
344
|
+
edge->addArrSize(LLVMModuleSet::getLLVMModuleSet()->getSVFValue(cs->getArgOperand(0)));
|
|
345
|
+
edge->addArrSize(LLVMModuleSet::getLLVMModuleSet()->getSVFValue(cs->getArgOperand(1)));
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
else
|
|
349
|
+
{
|
|
350
|
+
if (cs->arg_size() > 0)
|
|
351
|
+
{
|
|
352
|
+
const llvm::Value* val = cs->getArgOperand(0);
|
|
353
|
+
SVFValue* svfval = LLVMModuleSet::getLLVMModuleSet()->getSVFValue(val);
|
|
354
|
+
edge->addArrSize(svfval);
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
return edge;
|
|
358
|
+
}
|
|
359
|
+
|
|
300
360
|
/// Add Copy edge
|
|
301
361
|
inline CopyStmt* addCopyEdge(NodeID src, NodeID dst)
|
|
302
362
|
{
|