Skip to content

goto_rw: left shift may be larger than object size #6723

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

Merged
merged 1 commit into from
Mar 24, 2022
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
17 changes: 17 additions & 0 deletions regression/cbmc/overflow/leftshift_overflow-c99-full-slice.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
CORE
leftshift_overflow.c
--signed-overflow-check --c99 --full-slice
^EXIT=10$
^SIGNAL=0$
^\[.*\] line 8 arithmetic overflow on signed shl in .*: FAILURE$
^\[.*\] line 11 arithmetic overflow on signed shl in .*: SUCCESS$
^\[.*\] line 17 arithmetic overflow on signed shl in .*: SUCCESS$
^\[.*\] line 20 arithmetic overflow on signed shl in .*: FAILURE$
^\[.*\] line 26 arithmetic overflow on signed shl in .*: FAILURE$
^\[.*\] line 30 arithmetic overflow on signed shl in .*: FAILURE$
^\*\* 4 of 7 failed
^VERIFICATION FAILED$
--
^warning: ignoring
^\[.*\] line 14 arithmetic overflow on signed shl in .*: .*
^\[.*\] line 23 arithmetic overflow on signed shl in .*: .*
3 changes: 1 addition & 2 deletions src/analyses/goto_rw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,8 @@ void rw_range_sett::get_objects_shift(
if(sh_range_start>=0 && sh_range_start<src_size)
get_objects_rec(mode, shift.op(), sh_range_start, sh_size);
}
else
if(src_size - dist_r >= 0)
{
assert(src_size-dist_r>=0);
range_spect sh_size=std::min(size, src_size-dist_r);

get_objects_rec(mode, shift.op(), range_start, sh_size);
Expand Down