Skip to content

Commit 2770756

Browse files
author
Daniel Kroening
authored
Merge pull request #251 from danpoe/array-type-mismatch-bugfix
Array type mismatch bugfix
2 parents a9ba37f + 4d806e4 commit 2770756

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

src/goto-symex/goto_symex_state.cpp

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -934,10 +934,20 @@ void goto_symex_statet::rename(
934934
{
935935
l1_type_entry=l1_types.insert(std::make_pair(l1_identifier, type));
936936

937-
if(!l1_type_entry.second)
937+
if(!l1_type_entry.second) // was already in map
938938
{
939-
type=l1_type_entry.first->second;
940-
return;
939+
// do not change a complete array type to an incomplete one
940+
941+
const typet &type_prev=l1_type_entry.first->second;
942+
943+
if(type.id()!=ID_array ||
944+
type_prev.id()!=ID_array ||
945+
to_array_type(type).is_incomplete() ||
946+
to_array_type(type_prev).is_complete())
947+
{
948+
type=l1_type_entry.first->second;
949+
return;
950+
}
941951
}
942952
}
943953

0 commit comments

Comments
 (0)