Skip to content

Commit

Permalink
Merge pull request #1467 from jumormt/master
Browse files Browse the repository at this point in the history
add assertion message when calling lb/ub if interval is bottom, don't…
  • Loading branch information
yuleisui authored May 25, 2024
2 parents 442e106 + 12a9d41 commit 857b8c1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions svf/include/AE/Core/IntervalValue.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,14 +205,14 @@ class IntervalValue
/// Return the lower bound
const BoundedInt &lb() const
{
assert(!this->isBottom());
assert(!this->isBottom() && "bottom interval does not have lower bound");
return this->_lb;
}

/// Return the upper bound
const BoundedInt &ub() const
{
assert(!this->isBottom());
assert(!this->isBottom() && "bottom interval does not have upper bound");
return this->_ub;
}

Expand Down
6 changes: 4 additions & 2 deletions svf/lib/AE/Svfexe/SVFIR2AbsState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,11 @@ IntervalValue SVFIR2AbsState::getUIntToFPValue(const AbstractState& as, const SV

IntervalValue SVFIR2AbsState::getTruncValue(const AbstractState& as, const SVF::SVFVar* var, const SVFType* dstType)
{
const IntervalValue& itv = as[var->getId()].getInterval();
if(itv.isBottom()) return itv;
// get the value of ub and lb
s64_t int_lb = as[var->getId()].getInterval().lb().getIntNumeral();
s64_t int_ub = as[var->getId()].getInterval().ub().getIntNumeral();
s64_t int_lb = itv.lb().getIntNumeral();
s64_t int_ub = itv.ub().getIntNumeral();
// get dst type
u32_t dst_bits = dstType->getByteSize() * 8;
if (dst_bits == 8)
Expand Down

0 comments on commit 857b8c1

Please sign in to comment.