Skip to content

Commit 0d007d2

Browse files
committed
SMV: flatten hierarchy on parse tree
1 parent 20c2a2d commit 0d007d2

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/smvlang/smv_typecheck.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,14 @@ Function: smv_typecheckt::flatten_hierarchy
196196

197197
void smv_typecheckt::flatten_hierarchy(smv_parse_treet::modulet &smv_module)
198198
{
199-
for(auto &element : smv_module.elements)
199+
// Not using ranged for since we will append to the list we are
200+
// iterating over! This avoids recursion.
201+
for(auto element_it = smv_module.elements.begin();
202+
element_it != smv_module.elements.end();
203+
++element_it)
200204
{
205+
auto &element = *element_it;
206+
201207
if(element.is_var() && element.expr.type().id() == ID_smv_submodule)
202208
{
203209
exprt &inst =
@@ -238,6 +244,7 @@ void smv_typecheckt::instantiate(
238244
const exprt::operandst &operands,
239245
const source_locationt &location)
240246
{
247+
#if 0
241248
symbol_table_baset::symbolst::const_iterator s_it =
242249
symbol_table.symbols.find(identifier);
243250

@@ -373,7 +380,7 @@ void smv_typecheckt::instantiate(
373380
instantiate_rename(tmp, rename_map);
374381
smv_module.add_trans(tmp);
375382
}
376-
383+
#endif
377384
}
378385

379386
/*******************************************************************\

0 commit comments

Comments
 (0)