-
Notifications
You must be signed in to change notification settings - Fork 436
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
opaque pointer stage 2-1 #1304
opaque pointer stage 2-1 #1304
Conversation
} | ||
else | ||
{ | ||
assert(false && (LLVMUtil::dumpValue(value) + "Unknown llvm Type, cannot get Ptr Element Type").c_str()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better to dump this unknown value.
svf-llvm/lib/SymbolTableBuilder.cpp
Outdated
{ | ||
// collect object type in instructions (alloc, heap) and globals | ||
if (LLVMUtil::isObject(val)) { | ||
const Type *objtype = LLVMUtil::getPointeeType(val); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would void* x = malloc() work here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Object type has to be inferred here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Object type has to be inferred here?
I agree. For malloc site, this should be done after inferring malloc type. For other types, it is ok to collect here.
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #1304 +/- ##
==========================================
+ Coverage 64.61% 64.64% +0.02%
==========================================
Files 225 225
Lines 23892 23875 -17
==========================================
- Hits 15438 15434 -4
+ Misses 8454 8441 -13
|
svf-llvm/lib/SymbolTableBuilder.cpp
Outdated
@@ -590,8 +592,8 @@ ObjTypeInfo* SymbolTableBuilder::createObjTypeInfo(const Value* val) | |||
// (2) Other objects (e.g., alloca, global, etc.) | |||
else | |||
{ | |||
if(const PointerType* refTy = SVFUtil::dyn_cast<PointerType>(val->getType())) | |||
objTy = getPtrElementType(refTy); | |||
if(SVFUtil::isa<PointerType>(val->getType())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks to me that this pointee type has to be inferred if this val is an object from a malloc site.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks to me that this pointee type has to be inferred if this val is an object from a malloc site.
This branch cannot be a malloc site. The object is alloca, global, etc. The malloc site is not yet done (to be done in inferTypeOfHeapObjOrStaticObj).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see.
@@ -598,6 +590,8 @@ ObjTypeInfo* SymbolTableBuilder::createObjTypeInfo(const Value* val) | |||
|
|||
if (objTy) | |||
{ | |||
// collect object type information | |||
(void) getOrAddSVFTypeInfo(objTy); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should return an SVFType ad use it at line 596.
c889648
to
eb941d8
Compare
infer object type based on instructions or globals