Skip to content

Commit 01ede2d

Browse files
committed
Remove ns.follow when types cannot be hidden behind tags
Neither arrays nor Booleans use tag types.
1 parent 1837ea7 commit 01ede2d

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/util/expr_initializer.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ exprt expr_initializert<nondet>::expr_initializer_rec(
263263
{
264264
exprt result = expr_initializer_rec(ns.follow(type), source_location);
265265
// we might have mangled the type for arrays, so keep that
266-
if(ns.follow(type).id()!=ID_array)
266+
if(type.id() != ID_array)
267267
result.type()=type;
268268

269269
return result;

src/util/expr_util.cpp

+3-4
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,9 @@ exprt is_not_zero(
104104
// Note that this returns a proper bool_typet(), not a C/C++ boolean.
105105
// To get a C/C++ boolean, add a further typecast.
106106

107-
const typet &src_type=
108-
src.type().id()==ID_c_enum_tag?
109-
ns.follow_tag(to_c_enum_tag_type(src.type())):
110-
ns.follow(src.type());
107+
const typet &src_type = src.type().id() == ID_c_enum_tag
108+
? ns.follow_tag(to_c_enum_tag_type(src.type()))
109+
: src.type();
111110

112111
if(src_type.id()==ID_bool) // already there
113112
return src; // do nothing

0 commit comments

Comments
 (0)