Skip to content

Commit 420cff3

Browse files
committed
Simplify concatenation only if types match
When simplifying the operands of a concatenation permits replacing the concat expression by one of the (simplified) operands, only do so if that wouldn't result in a type mismatch.
1 parent e2a5430 commit 420cff3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/util/simplify_expr_int.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -955,7 +955,9 @@ bool simplify_exprt::simplify_concatenation(exprt &expr)
955955
}
956956

957957
// { x } = x
958-
if(expr.operands().size()==1)
958+
if(
959+
expr.operands().size() == 1 &&
960+
base_type_eq(expr.op0().type(), expr.type(), ns))
959961
{
960962
exprt tmp;
961963
tmp.swap(expr.op0());

0 commit comments

Comments
 (0)