File tree 1 file changed +7
-2
lines changed 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,11 @@ 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.\n old type: '" +
31
+ old_expr.type ().pretty () + " '\n new.type: '" + new_expr.type ().pretty () +
32
+ " ')" );
29
33
expr_map.insert (std::pair<irep_idt, exprt>(
30
34
old_expr.get_identifier (), new_expr));
31
35
}
@@ -46,7 +50,8 @@ bool replace_symbolt::replace_symbol_expr(symbol_exprt &s) const
46
50
47
51
DATA_INVARIANT (
48
52
s.type () == it->second .type (),
49
- " type of symbol to be replaced should match" );
53
+ " types to be replaced should match.\n s.type: '" + s.type ().pretty () +
54
+ " '\n it->second.type: '" + it->second .type ().pretty () + " ')" );
50
55
static_cast <exprt &>(s) = it->second ;
51
56
52
57
return false ;
You can’t perform that action at this time.
0 commit comments