Skip to content

Commit 8eaf89e

Browse files
committed
Apply symbol replacement in type_arg members
This is used int the precursor of a typechecked sizeof expression.
1 parent 9d4e0ca commit 8eaf89e

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/util/replace_symbol.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,16 @@ bool replace_symbolt::replace(
104104
result=false;
105105
}
106106

107+
const irept &type_arg=dest.find(ID_type_arg);
108+
109+
if(type_arg.is_not_nil())
110+
{
111+
typet &type=static_cast<typet &>(dest.add(ID_type_arg));
112+
113+
if(!replace(type))
114+
result=false;
115+
}
116+
107117
const irept &va_arg_type=dest.find(ID_C_va_arg_type);
108118

109119
if(va_arg_type.is_not_nil())
@@ -139,6 +149,12 @@ bool replace_symbolt::have_to_replace(const exprt &dest) const
139149
if(have_to_replace(static_cast<const typet &>(c_sizeof_type)))
140150
return true;
141151

152+
const irept &type_arg=dest.find(ID_type_arg);
153+
154+
if(type_arg.is_not_nil())
155+
if(have_to_replace(static_cast<const typet &>(type_arg)))
156+
return true;
157+
142158
const irept &va_arg_type=dest.find(ID_C_va_arg_type);
143159

144160
if(va_arg_type.is_not_nil())

0 commit comments

Comments
 (0)