File tree Expand file tree Collapse file tree 1 file changed +25
-2
lines changed Expand file tree Collapse file tree 1 file changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -163,13 +163,36 @@ void goto_convert_functionst::convert_function(
163
163
symbol.is_compiled ()) /* goto_inline may have removed the body */
164
164
return ;
165
165
166
+ const size_t ERROR_MSG_LEN = 512 ;
167
+ char parameter_error_message[ERROR_MSG_LEN];
166
168
// we have a body, make sure all parameter names are valid
167
169
for (const auto &p : f.parameter_identifiers )
168
170
{
169
- DATA_INVARIANT (!p.empty (), " parameter identifier should not be empty" );
171
+ if (p.empty ())
172
+ {
173
+ snprintf (parameter_error_message,
174
+ ERROR_MSG_LEN - 1 ,
175
+ " parameter identifier should not be empty\n "
176
+ " function: %s\n "
177
+ " parameter: %s" ,
178
+ identifier.c_str (),
179
+ p.c_str ());
180
+ }
181
+ DATA_INVARIANT (!p.empty (), parameter_error_message);
182
+
183
+ if (!symbol_table.has_symbol (p))
184
+ {
185
+ snprintf (parameter_error_message,
186
+ ERROR_MSG_LEN - 1 ,
187
+ " parameter identifier must be a known symbol\n "
188
+ " function: %s\n "
189
+ " parameter: %s" ,
190
+ identifier.c_str (),
191
+ p.c_str ());
192
+ }
170
193
DATA_INVARIANT (
171
194
symbol_table.has_symbol (p),
172
- " parameter identifier must be a known symbol " );
195
+ parameter_error_message );
173
196
}
174
197
175
198
lifetimet parent_lifetime = lifetime;
You can’t perform that action at this time.
0 commit comments