Skip to content

Commit 6a58ed9

Browse files
committed
Print function & parameter in convert_function errors
1 parent faaf50e commit 6a58ed9

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

src/goto-programs/goto_convert_functions.cpp

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,19 @@ void goto_convert_functionst::convert_function(
166166
// we have a body, make sure all parameter names are valid
167167
for(const auto &p : f.parameter_identifiers)
168168
{
169-
DATA_INVARIANT(!p.empty(), "parameter identifier should not be empty");
170-
DATA_INVARIANT(
169+
DATA_INVARIANT_WITH_DIAGNOSTICS(
170+
!p.empty(),
171+
"parameter identifier should not be empty",
172+
"function:",
173+
identifier);
174+
175+
DATA_INVARIANT_WITH_DIAGNOSTICS(
171176
symbol_table.has_symbol(p),
172-
"parameter identifier must be a known symbol");
177+
"parameter identifier must be a known symbol",
178+
"function:",
179+
identifier,
180+
"parameter:",
181+
p);
173182
}
174183

175184
lifetimet parent_lifetime = lifetime;

0 commit comments

Comments
 (0)