Skip to content

Commit 2064849

Browse files
Use type_checked_cast in boolbv_width
This performs the necessary checks to ensure the type is a well formed pointer type.
1 parent c5fc351 commit 2064849

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/solvers/flattening/boolbv_width.cpp

+1-4
Original file line numberDiff line numberDiff line change
@@ -194,10 +194,7 @@ const boolbv_widtht::entryt &boolbv_widtht::get_entry(const typet &type) const
194194
// no width
195195
}
196196
else if(type_id==ID_pointer)
197-
{
198-
entry.total_width=to_pointer_type(type).get_width();
199-
DATA_INVARIANT(entry.total_width!=0, "pointer must have width");
200-
}
197+
entry.total_width = type_checked_cast<pointer_typet>(type).get_width();
201198
else if(type_id==ID_symbol)
202199
entry=get_entry(ns.follow(type));
203200
else if(type_id==ID_struct_tag)

0 commit comments

Comments
 (0)