File tree Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -45,9 +45,13 @@ void ansi_c_convert_typet::read_rec(const typet &type)
45
45
c_qualifiers.is_volatile =true ;
46
46
else if (type.id ()==ID_asm)
47
47
{
48
- if (type.has_subtype () &&
49
- type.subtype ().id ()==ID_string_constant)
50
- c_storage_spec.asm_label = to_string_constant (type.subtype ()).get_value ();
48
+ // These can have up to 5 subtypes; we only use the first one.
49
+ const auto &type_with_subtypes = to_type_with_subtypes (type);
50
+ if (
51
+ !type_with_subtypes.subtypes ().empty () &&
52
+ type_with_subtypes.subtypes ()[0 ].id () == ID_string_constant)
53
+ c_storage_spec.asm_label =
54
+ to_string_constant (type_with_subtypes.subtypes ()[0 ]).get_value ();
51
55
}
52
56
else if (type.id ()==ID_section &&
53
57
type.has_subtype () &&
Original file line number Diff line number Diff line change @@ -52,11 +52,12 @@ void c_storage_spect::read(const typet &type)
52
52
{
53
53
alias = to_string_constant (type.subtype ()).get_value ();
54
54
}
55
- else if (type. id ()==ID_asm &&
56
- type. has_subtype () &&
57
- type. subtype () .id ()== ID_string_constant)
55
+ else if (
56
+ type. id () == ID_asm && ! to_type_with_subtypes ( type). subtypes (). empty () &&
57
+ to_type_with_subtypes ( type). subtypes ()[ 0 ] .id () == ID_string_constant)
58
58
{
59
- asm_label = to_string_constant (type.subtype ()).get_value ();
59
+ asm_label =
60
+ to_string_constant (to_type_with_subtypes (type).subtypes ()[0 ]).get_value ();
60
61
}
61
62
else if (type.id ()==ID_section &&
62
63
type.has_subtype () &&
You can’t perform that action at this time.
0 commit comments