Skip to content

Commit

Permalink
fix if offsetVarAndGepTypePair.second is nullptr since it is from Ext…
Browse files Browse the repository at this point in the history
…ernalAPI
  • Loading branch information
jiawei.wang committed Nov 17, 2023
1 parent e4faa11 commit 47b4181
Showing 1 changed file with 3 additions and 0 deletions.
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 @@ APOffset AccessPath::computeConstantByteOffset() const
/// 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
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

0 comments on commit 47b4181

Please sign in to comment.