Skip to content

Commit ebc78fe

Browse files
Thomas Kileythomasspriggs
authored andcommitted
Do not wrap parameter type in another pointer
In order to make the type of the argument match the type of the parameter.
1 parent 62df39e commit ebc78fe

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/goto-harness/recursive_initialization.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,12 +209,12 @@ void recursive_initializationt::initialize(
209209
{
210210
const auto &fun_type_params =
211211
to_code_type(fun_symbol.type).parameters();
212-
const typet &size_var_type = fun_type_params.back().type();
212+
const pointer_typet *size_var_type =
213+
type_try_dynamic_cast<pointer_typet>(fun_type_params.back().type());
214+
INVARIANT(size_var_type, "Size parameter must have pointer type.");
213215
body.add(code_function_callt{
214216
fun_symbol.symbol_expr(),
215-
{depth,
216-
address_of_exprt{lhs},
217-
null_pointer_exprt{pointer_type(size_var_type)}}});
217+
{depth, address_of_exprt{lhs}, null_pointer_exprt{*size_var_type}}});
218218
}
219219
return;
220220
}

0 commit comments

Comments
 (0)