Skip to content

Commit 8e52f8d

Browse files
author
Daniel Kroening
committed
use invariant
1 parent efe922e commit 8e52f8d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/goto-programs/link_goto_model.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ static bool link_functions(
104104
{
105105
// the linking code will have ensured that types match
106106
rename_symbol(src_func.type);
107-
assert(base_type_eq(in_dest_symbol_table.type, src_func.type, ns));
107+
INVARIANT(base_type_eq(in_dest_symbol_table.type, src_func.type, ns),
108+
"linking ensures that types match");
108109
}
109110
}
110111
}
@@ -117,7 +118,7 @@ static bool link_functions(
117118
{
118119
const symbolt &symbol=it->second;
119120

120-
assert(symbol.value.id()==ID_symbol);
121+
INVARIANT(symbol.value.id()==ID_symbol, "must have symbol");
121122
const irep_idt &id=to_symbol_expr(symbol.value).get_identifier();
122123

123124
#if 0
@@ -126,7 +127,8 @@ static bool link_functions(
126127
std::cerr << symbol << '\n';
127128
std::cerr << ns.lookup(id) << '\n';
128129
}
129-
assert(base_type_eq(symbol.type, ns.lookup(id).type, ns));
130+
INVARIANT(base_type_eq(symbol.type, ns.lookup(id).type, ns),
131+
"type matches");
130132
#endif
131133

132134
macro_application.insert_expr(symbol.name, id);

0 commit comments

Comments
 (0)