Skip to content

Commit 31f1b59

Browse files
authored
Merge pull request #6723 from tautschnig/bugfixes/goto_rw-left-shift
goto_rw: left shift may be larger than object size
2 parents e2793a7 + 542ce54 commit 31f1b59

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
CORE
2+
leftshift_overflow.c
3+
--signed-overflow-check --c99 --full-slice
4+
^EXIT=10$
5+
^SIGNAL=0$
6+
^\[.*\] line 8 arithmetic overflow on signed shl in .*: FAILURE$
7+
^\[.*\] line 11 arithmetic overflow on signed shl in .*: SUCCESS$
8+
^\[.*\] line 17 arithmetic overflow on signed shl in .*: SUCCESS$
9+
^\[.*\] line 20 arithmetic overflow on signed shl in .*: FAILURE$
10+
^\[.*\] line 26 arithmetic overflow on signed shl in .*: FAILURE$
11+
^\[.*\] line 30 arithmetic overflow on signed shl in .*: FAILURE$
12+
^\*\* 4 of 7 failed
13+
^VERIFICATION FAILED$
14+
--
15+
^warning: ignoring
16+
^\[.*\] line 14 arithmetic overflow on signed shl in .*: .*
17+
^\[.*\] line 23 arithmetic overflow on signed shl in .*: .*

src/analyses/goto_rw.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,8 @@ void rw_range_sett::get_objects_shift(
217217
if(sh_range_start>=0 && sh_range_start<src_size)
218218
get_objects_rec(mode, shift.op(), sh_range_start, sh_size);
219219
}
220-
else
220+
if(src_size - dist_r >= 0)
221221
{
222-
assert(src_size-dist_r>=0);
223222
range_spect sh_size=std::min(size, src_size-dist_r);
224223

225224
get_objects_rec(mode, shift.op(), range_start, sh_size);

0 commit comments

Comments
 (0)