svf-lib 1.0.1702 → 1.0.1704
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.
|
Binary file
|
|
Binary file
|
|
@@ -119,7 +119,7 @@ inline bool isNullPtrSym(const Value* val)
|
|
|
119
119
|
static inline Type* getPtrElementType(const PointerType* pty)
|
|
120
120
|
{
|
|
121
121
|
#if (LLVM_VERSION_MAJOR < 14)
|
|
122
|
-
return pty->
|
|
122
|
+
return pty->getPointerElementType();
|
|
123
123
|
#else
|
|
124
124
|
assert(!pty->isOpaque() && "Opaque Pointer is used, please recompile the source adding '-Xclang -no-opaque-pointers'");
|
|
125
125
|
return pty->getNonOpaquePointerElementType();
|
|
@@ -384,11 +384,14 @@ void removeUnusedFuncsAndAnnotationsAndGlobalVariables(std::vector<Function*> re
|
|
|
384
384
|
inline u32_t SVFType2ByteSize(const SVFType* type)
|
|
385
385
|
{
|
|
386
386
|
const llvm::Type* llvm_rhs = LLVMModuleSet::getLLVMModuleSet()->getLLVMType(type);
|
|
387
|
-
|
|
387
|
+
const llvm::PointerType* llvm_rhs_ptr = SVFUtil::dyn_cast<PointerType>(llvm_rhs);
|
|
388
|
+
assert(llvm_rhs_ptr && "not a pointer type?");
|
|
389
|
+
const Type *ptrElementType = getPtrElementType(llvm_rhs_ptr);
|
|
390
|
+
u32_t llvm_rhs_size = LLVMUtil::getTypeSizeInBytes(ptrElementType);
|
|
388
391
|
u32_t llvm_elem_size = -1;
|
|
389
|
-
if (
|
|
392
|
+
if (ptrElementType->isArrayTy() && llvm_rhs_size > 0)
|
|
390
393
|
{
|
|
391
|
-
size_t array_len =
|
|
394
|
+
size_t array_len = ptrElementType->getArrayNumElements();
|
|
392
395
|
llvm_elem_size = llvm_rhs_size / array_len;
|
|
393
396
|
}
|
|
394
397
|
else
|