Skip to content

Commit d1c2855

Browse files
Validate config is initialised when a member_offset_expr is constructed
This will save time hunting for the cause of problems when unit tests don't initialise the config.
1 parent 143155b commit d1c2855

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/util/pointer_offset_size.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ optionalt<exprt> member_offset_expr(
241241
const irep_idt &member,
242242
const namespacet &ns)
243243
{
244+
PRECONDITION(size_type().get_width() != 0);
244245
exprt result=from_integer(0, size_type());
245246
std::size_t bit_field_bits=0;
246247

0 commit comments

Comments
 (0)