Skip to content

Commit 2312d47

Browse files
authored
Merge pull request #6719 from tautschnig/bugfixes/goto_rw_size
goto_rw: do not assume that all types have constant size
2 parents 4996426 + 3cca95c commit 2312d47

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
main.c
3+
--little-endian --full-slice
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
^VERIFICATION SUCCESSFUL$
7+
--
8+
^warning: ignoring

src/analyses/goto_rw.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,15 +148,20 @@ void rw_range_sett::get_objects_byte_extract(
148148
const range_spect &range_start,
149149
const range_spect &size)
150150
{
151+
auto object_size_bits_opt = pointer_offset_bits(be.op().type(), ns);
151152
const exprt simp_offset=simplify_expr(be.offset(), ns);
152153

153154
auto index = numeric_cast<mp_integer>(simp_offset);
154-
if(range_start == -1 || !index.has_value())
155+
if(
156+
range_start == -1 || !index.has_value() ||
157+
!object_size_bits_opt.has_value())
158+
{
155159
get_objects_rec(mode, be.op(), -1, size);
160+
}
156161
else
157162
{
158163
*index *= 8;
159-
if(*index >= *pointer_offset_bits(be.op().type(), ns))
164+
if(*index >= *object_size_bits_opt)
160165
return;
161166

162167
endianness_mapt map(

0 commit comments

Comments
 (0)