File tree 1 file changed +6
-2
lines changed
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(
25
25
const symbol_exprt &old_expr,
26
26
const exprt &new_expr)
27
27
{
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 ());
29
32
expr_map.insert (std::pair<irep_idt, exprt>(
30
33
old_expr.get_identifier (), new_expr));
31
34
}
@@ -46,7 +49,8 @@ bool replace_symbolt::replace_symbol_expr(symbol_exprt &s) const
46
49
47
50
DATA_INVARIANT (
48
51
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 ());
50
54
static_cast <exprt &>(s) = it->second ;
51
55
52
56
return false ;
You can’t perform that action at this time.
0 commit comments