File tree 2 files changed +25
-2
lines changed
regression/cbmc/Bitfields1
2 files changed +25
-2
lines changed Original file line number Diff line number Diff line change 1
- KNOWNBUG
1
+ CORE
2
2
main.c
3
3
4
4
^EXIT=0$
Original file line number Diff line number Diff line change @@ -354,7 +354,30 @@ c_typecastt::c_typet c_typecastt::get_c_type(
354
354
else if (type.id ()==ID_complex)
355
355
return COMPLEX;
356
356
else if (type.id ()==ID_c_bit_field)
357
- return get_c_type (to_c_bit_field_type (type).subtype ());
357
+ {
358
+ const auto &bit_field_type = to_c_bit_field_type (type);
359
+
360
+ // We take the underlying type, and then apply the number
361
+ // of bits given
362
+ typet underlying_type;
363
+
364
+ if (bit_field_type.subtype ().id () == ID_c_enum_tag)
365
+ {
366
+ const auto &followed =
367
+ ns.follow_tag (to_c_enum_tag_type (bit_field_type.subtype ()));
368
+ if (followed.is_incomplete ())
369
+ return INT;
370
+ else
371
+ underlying_type = followed.subtype ();
372
+ }
373
+ else
374
+ underlying_type = bit_field_type.subtype ();
375
+
376
+ const bitvector_typet new_type (
377
+ underlying_type.id (), bit_field_type.get_width ());
378
+
379
+ return get_c_type (new_type);
380
+ }
358
381
359
382
return OTHER;
360
383
}
You can’t perform that action at this time.
0 commit comments