|
13 | 13 | #include "fresh_symbol.h"
|
14 | 14 | #include "pointer_offset_size.h"
|
15 | 15 | #include "string_constant.h"
|
| 16 | +#include "type_eq.h" |
16 | 17 |
|
17 | 18 | /// Allocates a new object, either by creating a local variable with automatic
|
18 | 19 | /// lifetime, a global variable with static lifetime, or by dynamically
|
@@ -183,7 +184,7 @@ exprt allocate_objectst::allocate_dynamic_object(
|
183 | 184 | output_code.add(assign);
|
184 | 185 |
|
185 | 186 | exprt malloc_symbol_expr =
|
186 |
| - ns.follow(malloc_sym.symbol_expr().type()) != ns.follow(target_expr.type()) |
| 187 | + !type_eq(malloc_sym.symbol_expr().type(), target_expr.type(), ns) |
187 | 188 | ? (exprt)typecast_exprt(malloc_sym.symbol_expr(), target_expr.type())
|
188 | 189 | : malloc_sym.symbol_expr();
|
189 | 190 |
|
@@ -213,8 +214,7 @@ exprt allocate_objectst::allocate_non_dynamic_object(
|
213 | 214 | symbols_created.push_back(&aux_symbol);
|
214 | 215 |
|
215 | 216 | exprt aoe =
|
216 |
| - ns.follow(aux_symbol.symbol_expr().type()) != |
217 |
| - ns.follow(target_expr.type().subtype()) |
| 217 | + !type_eq(aux_symbol.symbol_expr().type(), target_expr.type().subtype(), ns) |
218 | 218 | ? (exprt)typecast_exprt(
|
219 | 219 | address_of_exprt(aux_symbol.symbol_expr()), target_expr.type())
|
220 | 220 | : address_of_exprt(aux_symbol.symbol_expr());
|
|
0 commit comments