File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,10 @@ void replace_symbolt::insert(
2525 const symbol_exprt &old_expr,
2626 const exprt &new_expr)
2727{
28- PRECONDITION (old_expr.type () == new_expr.type ());
28+ PRECONDITION_WITH_DIAGNOSTICS (
29+ old_expr.type () == new_expr.type (),
30+ " types to be replaced should match. old type:\n " +
31+ old_expr.type ().pretty () + " \n new.type:\n " + new_expr.type ().pretty ());
2932 expr_map.insert (std::pair<irep_idt, exprt>(
3033 old_expr.get_identifier (), new_expr));
3134}
@@ -46,7 +49,8 @@ bool replace_symbolt::replace_symbol_expr(symbol_exprt &s) const
4649
4750 DATA_INVARIANT (
4851 s.type () == it->second .type (),
49- " type of symbol to be replaced should match" );
52+ " types to be replaced should match. s.type:\n " + s.type ().pretty () +
53+ " \n it->second.type:\n " + it->second .type ().pretty ());
5054 static_cast <exprt &>(s) = it->second ;
5155
5256 return false ;
You can’t perform that action at this time.
0 commit comments