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

add assertion message when calling lb/ub if interval is bottom, don't… #1467

Merged
merged 1 commit into from
May 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
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
Loading