Skip to content

Commit 3681d89

Browse files
authored
Merge pull request #3076 from diffblue/base-is-symbol-type
struct_typet::baset: no need for cast to symbol_type
2 parents aca054f + c134980 commit 3681d89

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

jbmc/src/java_bytecode/java_bytecode_language.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,8 +312,7 @@ static void infer_opaque_type_fields(
312312
+ "' (which was missing a field '" + id2string(component_name)
313313
+ "' referenced from method '" + id2string(method.name)
314314
+ "') should have an opaque superclass");
315-
const symbol_typet &superclass_type =
316-
to_symbol_type(class_type->bases().front().type());
315+
const auto &superclass_type = class_type->bases().front().type();
317316
class_symbol_id = superclass_type.get_identifier();
318317
class_type = &to_class_type(ns.follow(superclass_type));
319318
}

src/goto-programs/class_hierarchy.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ void class_hierarchy_grapht::populate(const symbol_tablet &symbol_table)
4747

4848
for(const auto &base : struct_type.bases())
4949
{
50-
const irep_idt &parent = to_symbol_type(base.type()).get_identifier();
50+
const irep_idt &parent = base.type().get_identifier();
5151
if(!parent.empty())
5252
{
5353
const auto parent_node_it = nodes_by_name.find(parent);
@@ -159,7 +159,7 @@ void class_hierarchyt::operator()(const symbol_tablet &symbol_table)
159159

160160
for(const auto &base : struct_type.bases())
161161
{
162-
const irep_idt &parent = to_symbol_type(base.type()).get_identifier();
162+
const irep_idt &parent = base.type().get_identifier();
163163
if(parent.empty())
164164
continue;
165165

0 commit comments

Comments
 (0)