@@ -108,15 +108,14 @@ exprt goto_symext::address_arithmetic(
108
108
// recursive call
109
109
result=address_arithmetic (be.op (), state, guard, keep_array);
110
110
111
- if (ns.follow (be.op ().type ()).id ()==ID_array &&
112
- result.id ()==ID_address_of)
111
+ if (be.op ().type ().id () == ID_array && result.id () == ID_address_of)
113
112
{
114
113
address_of_exprt &a=to_address_of_expr (result);
115
114
116
115
// turn &a of type T[i][j] into &(a[0][0])
117
- for (const typet *t=&(ns. follow ( a.type ().subtype () ));
118
- t->id ()== ID_array && !base_type_eq (expr.type (), *t, ns);
119
- t=&(ns. follow (*t). subtype ()))
116
+ for (const typet *t = &( a.type ().subtype ());
117
+ t->id () == ID_array && !base_type_eq (expr.type (), *t, ns);
118
+ t = &(t-> subtype ()))
120
119
a.object ()=index_exprt (a.object (), from_integer (0 , index_type ()));
121
120
}
122
121
@@ -130,7 +129,7 @@ exprt goto_symext::address_arithmetic(
130
129
result=plus_exprt (result, offset);
131
130
132
131
// treat &array as &array[0]
133
- const typet &expr_type=ns. follow ( expr.type () );
132
+ const typet &expr_type = expr.type ();
134
133
typet dest_type_subtype;
135
134
136
135
if (expr_type.id ()==ID_array && !keep_array)
@@ -188,7 +187,7 @@ exprt goto_symext::address_arithmetic(
188
187
dereference_rec (result, state, guard, false );
189
188
190
189
// turn &array into &array[0]
191
- if (ns. follow ( result.type ()) .id ()== ID_array && !keep_array)
190
+ if (result.type ().id () == ID_array && !keep_array)
192
191
result=index_exprt (result, from_integer (0 , index_type ()));
193
192
194
193
// handle field-sensitive SSA symbol
@@ -223,7 +222,7 @@ exprt goto_symext::address_arithmetic(
223
222
result = address_arithmetic (tc_expr.op (), state, guard, keep_array);
224
223
225
224
// treat &array as &array[0]
226
- const typet &expr_type = ns. follow ( expr.type () );
225
+ const typet &expr_type = expr.type ();
227
226
typet dest_type_subtype;
228
227
229
228
if (expr_type.id () == ID_array && !keep_array)
@@ -237,7 +236,7 @@ exprt goto_symext::address_arithmetic(
237
236
throw unsupported_operation_exceptiont (
238
237
" goto_symext::address_arithmetic does not handle " + expr.id_string ());
239
238
240
- const typet &expr_type=ns. follow ( expr.type () );
239
+ const typet &expr_type = expr.type ();
241
240
INVARIANT ((expr_type.id ()==ID_array && !keep_array) ||
242
241
base_type_eq (pointer_type (expr_type), result.type (), ns),
243
242
" either non-persistent array or pointer to result" );
@@ -300,10 +299,9 @@ void goto_symext::dereference_rec(
300
299
// this may yield a new auto-object
301
300
trigger_auto_object (expr, state);
302
301
}
303
- else if (expr.id ()==ID_index &&
304
- to_index_expr (expr).array ().id ()==ID_member &&
305
- to_array_type (ns.follow (to_index_expr (expr).array ().type ())).
306
- size ().is_zero ())
302
+ else if (
303
+ expr.id () == ID_index && to_index_expr (expr).array ().id () == ID_member &&
304
+ to_array_type (to_index_expr (expr).array ().type ()).size ().is_zero ())
307
305
{
308
306
// This is an expression of the form x.a[i],
309
307
// where a is a zero-sized array. This gets
@@ -336,12 +334,11 @@ void goto_symext::dereference_rec(
336
334
337
335
exprt &object=address_of_expr.object ();
338
336
339
- const typet &expr_type=ns.follow (expr.type ());
340
337
expr = address_arithmetic (
341
338
object,
342
339
state,
343
340
guard,
344
- to_pointer_type (expr_type ).subtype ().id () == ID_array);
341
+ to_pointer_type (expr. type () ).subtype ().id () == ID_array);
345
342
}
346
343
else if (expr.id ()==ID_typecast)
347
344
{
0 commit comments