Skip to content

Commit 1837ea7

Browse files
committed
Replace use of ns.follow by type_eq
Using ns.follow on both sides of an operator== is better encapsulated in type_eq.
1 parent ccf528e commit 1837ea7

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/util/allocate_objects.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Author: Daniel Kroening, [email protected]
1313
#include "fresh_symbol.h"
1414
#include "pointer_offset_size.h"
1515
#include "string_constant.h"
16+
#include "type_eq.h"
1617

1718
/// Allocates a new object, either by creating a local variable with automatic
1819
/// lifetime, a global variable with static lifetime, or by dynamically
@@ -183,7 +184,7 @@ exprt allocate_objectst::allocate_dynamic_object(
183184
output_code.add(assign);
184185

185186
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)
187188
? (exprt)typecast_exprt(malloc_sym.symbol_expr(), target_expr.type())
188189
: malloc_sym.symbol_expr();
189190

src/util/simplify_expr_struct.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ bool simplify_exprt::simplify_member(exprt &expr)
200200
else if(op.id()==ID_union && op_type.id()==ID_union)
201201
{
202202
// trivial?
203-
if(ns.follow(to_union_expr(op).op().type())==ns.follow(expr.type()))
203+
if(type_eq(to_union_expr(op).op().type(), expr.type(), ns))
204204
{
205205
exprt tmp=to_union_expr(op).op();
206206
expr.swap(tmp);

0 commit comments

Comments
 (0)