Skip to content

Commit d1f617b

Browse files
committed
Apply symbol replacement in type_arg members
This is used int the precursor of a typechecked sizeof expression.
1 parent 118f41f commit d1f617b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/util/replace_symbol.cpp

+10
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@ bool replace_symbolt::replace(
100100
if(c_sizeof_type.is_not_nil() && have_to_replace(c_sizeof_type))
101101
result &= replace(static_cast<typet&>(dest.add(ID_C_c_sizeof_type)));
102102

103+
const typet &type_arg = static_cast<const typet &>(dest.find(ID_type_arg));
104+
if(type_arg.is_not_nil() && have_to_replace(type_arg))
105+
result &= replace(static_cast<typet &>(dest.add(ID_type_arg)));
106+
103107
const typet &va_arg_type =
104108
static_cast<const typet&>(dest.find(ID_C_va_arg_type));
105109
if(va_arg_type.is_not_nil() && have_to_replace(va_arg_type))
@@ -136,6 +140,12 @@ bool replace_symbolt::have_to_replace(const exprt &dest) const
136140
if(have_to_replace(static_cast<const typet &>(c_sizeof_type)))
137141
return true;
138142

143+
const irept &type_arg = dest.find(ID_type_arg);
144+
145+
if(type_arg.is_not_nil())
146+
if(have_to_replace(static_cast<const typet &>(type_arg)))
147+
return true;
148+
139149
const irept &va_arg_type=dest.find(ID_C_va_arg_type);
140150

141151
if(va_arg_type.is_not_nil())

0 commit comments

Comments
 (0)