Skip to content

Commit 3e490c9

Browse files
authored
Merge pull request #7390 from peterschrammel/ifexprt-diagnostics
Better diagnostics on with_exprt and ifexprt type mismatch
2 parents 139dac0 + d67fbf9 commit 3e490c9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/goto-symex/goto_symex_state.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,14 +261,15 @@ goto_symex_statet::rename(exprt expr, const namespacet &ns)
261261
*it = rename<level>(std::move(*it), ns).get();
262262

263263
const exprt &c_expr = as_const(expr);
264-
INVARIANT(
264+
INVARIANT_WITH_DIAGNOSTICS(
265265
(expr.id() != ID_with ||
266266
c_expr.type() == to_with_expr(c_expr).old().type()) &&
267267
(expr.id() != ID_if ||
268268
(c_expr.type() == to_if_expr(c_expr).true_case().type() &&
269269
c_expr.type() == to_if_expr(c_expr).false_case().type())),
270270
"Type of renamed expr should be the same as operands for with_exprt and "
271-
"if_exprt");
271+
"if_exprt",
272+
irep_pretty_diagnosticst{expr});
272273

273274
if(level == L2)
274275
expr = field_sensitivity.apply(ns, *this, std::move(expr), false);

0 commit comments

Comments
 (0)