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)
4545 c_qualifiers.is_volatile =true ;
4646 else if (type.id ()==ID_asm)
4747 {
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 ();
5155 }
5256 else if (type.id ()==ID_section &&
5357 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)
5252 {
5353 alias = to_string_constant (type.subtype ()).get_value ();
5454 }
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)
5858 {
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 ();
6061 }
6162 else if (type.id ()==ID_section &&
6263 type.has_subtype () &&
You can’t perform that action at this time.
0 commit comments