Skip to content
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
19 changes: 19 additions & 0 deletions regression/cbmc/struct10/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include <assert.h>

struct S
{
int x;
};

struct T
{
struct S a[2];
};

int main()
{
struct T t;
t.a[1].x = 42;
assert(t.a[1].x == 42);
return 0;
}
8 changes: 8 additions & 0 deletions regression/cbmc/struct10/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CORE
main.c

^EXIT=0$
^SIGNAL=0$
^VERIFICATION SUCCESSFUL$
--
^warning: ignoring
4 changes: 3 additions & 1 deletion src/solvers/flattening/boolbv_width.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ const boolbv_widtht::entryt &boolbv_widtht::get_entry(const typet &type) const
}
else if(type_id==ID_pointer)
entry.total_width = type_checked_cast<pointer_typet>(type).get_width();
else if(type_id==ID_symbol)
else if(type_id == ID_symbol_type)
entry=get_entry(ns.follow(type));
else if(type_id==ID_struct_tag)
entry=get_entry(ns.follow_tag(to_struct_tag_type(type)));
Expand All @@ -209,6 +209,8 @@ const boolbv_widtht::entryt &boolbv_widtht::get_entry(const typet &type) const
}
else if(type_id==ID_string)
entry.total_width=32;
else if(type_id != ID_empty)
UNIMPLEMENTED;

return entry;
}
Expand Down