File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -2711,6 +2711,17 @@ bool simplify_exprt::simplify_node_preorder(exprt &expr)
27112711 }
27122712 }
27132713
2714+ if (as_const (expr).type ().id () == ID_array)
2715+ {
2716+ const array_typet &array_type = to_array_type (as_const (expr).type ());
2717+ resultt<> simp_size = simplify_rec (array_type.size ());
2718+ if (simp_size.has_changed ())
2719+ {
2720+ to_array_type (expr.type ()).size () = simp_size.expr ;
2721+ result = false ;
2722+ }
2723+ }
2724+
27142725 return result;
27152726}
27162727
@@ -3035,7 +3046,10 @@ simplify_exprt::resultt<> simplify_exprt::simplify_rec(const exprt &expr)
30353046 else // change, new expression is 'tmp'
30363047 {
30373048 POSTCONDITION_WITH_DIAGNOSTICS (
3038- as_const (tmp).type () == expr.type (), tmp.pretty (), expr.pretty ());
3049+ (as_const (tmp).type ().id () == ID_array && expr.type ().id () == ID_array) ||
3050+ as_const (tmp).type () == expr.type (),
3051+ tmp.pretty (),
3052+ expr.pretty ());
30393053
30403054#ifdef USE_CACHE
30413055 // save in cache
You can’t perform that action at this time.
0 commit comments