Skip to content
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

fix if offsetVarAndGepTypePair.second is nullptr #1247

Merged
merged 2 commits into from
Nov 17, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions svf/lib/MemoryModel/AccessPath.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@
/// i = 0, type: [10 x i8]*, PtrType, op = 0
/// i = 1, type: [10 x i8], ArrType, op = 8
const SVFType* type = offsetVarAndGepTypePairs[i].second;
/// if offsetVarAndGepTypePairs[i].second is nullptr, it means
/// this GepStmt comes from external API, assert
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add more comments about this from SVFIRBuilder.cpp:getBaseTypeAndFlatternedFields

assert(type && "this GepStmt comes from ExternalAPI cannot call this api");

Check warning on line 117 in svf/lib/MemoryModel/AccessPath.cpp

View check run for this annotation

Codecov / codecov/patch

svf/lib/MemoryModel/AccessPath.cpp#L117

Added line #L117 was not covered by tests
const SVFType* type2 = type;
if (const SVFArrayType* arrType = SVFUtil::dyn_cast<SVFArrayType>(type))
{
Expand Down
Loading