Skip to content

Commit 147f05d

Browse files
author
Daniel Kroening
committed
add invariant on parent-child class relationship
1 parent 18d08bf commit 147f05d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/goto-programs/class_hierarchy.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ void class_hierarchy_grapht::populate(const symbol_tablet &symbol_table)
5050
const irep_idt &parent = to_symbol_type(base.type()).get_identifier();
5151
if(!parent.empty())
5252
{
53+
DATA_INVARIANT(nodes_by_name.find(parent)!=nodes_by_name.end(),
54+
"parent class not in symbol table");
5355
add_edge(
5456
nodes_by_name.at(parent), nodes_by_name.at(symbol_pair.first));
5557
}

0 commit comments

Comments
 (0)