File tree 1 file changed +8
-13
lines changed
1 file changed +8
-13
lines changed Original file line number Diff line number Diff line change @@ -343,25 +343,20 @@ void goto_symex_statet::rename(
343
343
}
344
344
else
345
345
{
346
- // this could go wrong, but we would have to re-typecheck ...
347
346
rename (expr.type (), irep_idt (), ns, level);
348
347
349
348
// do this recursively
350
349
Forall_operands (it, expr)
351
350
rename (*it, ns, level);
352
351
353
- // some fixes
354
- if (expr.id ()==ID_with)
355
- expr.type ()=to_with_expr (expr).old ().type ();
356
- else if (expr.id ()==ID_if)
357
- {
358
- DATA_INVARIANT (
359
- to_if_expr (expr).true_case ().type () ==
360
- to_if_expr (expr).false_case ().type (),
361
- " true case of to_if_expr should be of same type "
362
- " as false case" );
363
- expr.type ()=to_if_expr (expr).true_case ().type ();
364
- }
352
+ INVARIANT (
353
+ (expr.id () != ID_with ||
354
+ expr.type () == to_with_expr (expr).old ().type ()) &&
355
+ (expr.id () != ID_if ||
356
+ (expr.type () == to_if_expr (expr).true_case ().type () &&
357
+ expr.type () == to_if_expr (expr).false_case ().type ())),
358
+ " Type of renamed expr should be the same as operands for with_exprt and "
359
+ " if_exprt" );
365
360
}
366
361
}
367
362
You can’t perform that action at this time.
0 commit comments