File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -1260,6 +1260,12 @@ class unsignedbv_typet:public bitvector_typet
1260
1260
constant_exprt smallest_expr () const ;
1261
1261
constant_exprt zero_expr () const ;
1262
1262
constant_exprt largest_expr () const ;
1263
+
1264
+ void check (const validation_modet vm = validation_modet::INVARIANT) const
1265
+ {
1266
+ DATA_CHECK (
1267
+ !get (ID_width).empty (), " unsigned bitvector type must have width" );
1268
+ }
1263
1269
};
1264
1270
1265
1271
// / Check whether a reference to a typet is a \ref unsignedbv_typet.
@@ -1289,7 +1295,7 @@ inline const unsignedbv_typet &to_unsignedbv_type(const typet &type)
1289
1295
{
1290
1296
PRECONDITION (can_cast_type<unsignedbv_typet>(type));
1291
1297
const unsignedbv_typet &ret = static_cast <const unsignedbv_typet &>(type);
1292
- validate_type ( ret);
1298
+ ret. check ( );
1293
1299
return ret;
1294
1300
}
1295
1301
@@ -1298,7 +1304,7 @@ inline unsignedbv_typet &to_unsignedbv_type(typet &type)
1298
1304
{
1299
1305
PRECONDITION (can_cast_type<unsignedbv_typet>(type));
1300
1306
unsignedbv_typet &ret = static_cast <unsignedbv_typet &>(type);
1301
- validate_type ( ret);
1307
+ ret. check ( );
1302
1308
return ret;
1303
1309
}
1304
1310
You can’t perform that action at this time.
0 commit comments