File tree 1 file changed +15
-1
lines changed
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)
2711
2711
}
2712
2712
}
2713
2713
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
+
2714
2725
return result;
2715
2726
}
2716
2727
@@ -3035,7 +3046,10 @@ simplify_exprt::resultt<> simplify_exprt::simplify_rec(const exprt &expr)
3035
3046
else // change, new expression is 'tmp'
3036
3047
{
3037
3048
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 ());
3039
3053
3040
3054
#ifdef USE_CACHE
3041
3055
// save in cache
You can’t perform that action at this time.
0 commit comments