File tree Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -216,6 +216,13 @@ void ansi_c_convert_typet::read_rec(const typet &type)
216
216
{
217
217
c_storage_spec.alias =type.subtype ().get (ID_value);
218
218
}
219
+ else if (type.id ()==ID_pointer)
220
+ {
221
+ // pointers have a width, much like integers
222
+ pointer_typet tmp=to_pointer_type (type);
223
+ tmp.set_width (config.ansi_c .pointer_width );
224
+ other.push_back (tmp);
225
+ }
219
226
else
220
227
other.push_back (type);
221
228
}
Original file line number Diff line number Diff line change @@ -76,7 +76,10 @@ void c_typecheck_baset::typecheck_type(typet &type)
76
76
else if (type.id ()==ID_array)
77
77
typecheck_array_type (to_array_type (type));
78
78
else if (type.id ()==ID_pointer)
79
+ {
79
80
typecheck_type (type.subtype ());
81
+ INVARIANT (!type.get (ID_width).empty (), " pointers must have width" );
82
+ }
80
83
else if (type.id ()==ID_struct ||
81
84
type.id ()==ID_union)
82
85
typecheck_compound_type (to_struct_union_type (type));
Original file line number Diff line number Diff line change @@ -295,12 +295,12 @@ signedbv_typet pointer_diff_type()
295
295
296
296
pointer_typet pointer_type (const typet &subtype)
297
297
{
298
- return pointer_typet (subtype);
298
+ return pointer_typet (subtype, config. ansi_c . pointer_width );
299
299
}
300
300
301
301
reference_typet reference_type (const typet &subtype)
302
302
{
303
- return reference_typet (subtype);
303
+ return reference_typet (subtype, config. ansi_c . pointer_width );
304
304
}
305
305
306
306
typet void_type ()
You can’t perform that action at this time.
0 commit comments