Skip to content

DFCC: do not surface confusing warning #8694

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/goto-instrument/contracts/dynamic-frames/dfcc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,8 @@ void dfcct::transform_goto_model()
std::regex("(?!" CPROVER_PREFIX ").*"),
*generate_implementation,
goto_model,
message_handler);
message_handler,
true);
goto_model.goto_functions.update();

reinitialize_model();
Expand Down
7 changes: 5 additions & 2 deletions src/goto-instrument/generate_function_bodies.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -498,11 +498,14 @@ std::unique_ptr<generate_function_bodiest> generate_function_bodies_factory(
/// \param generate_function_body: Specifies what kind of body to generate
/// \param model: The goto-model in which to generate the function bodies
/// \param message_handler: Destination for status/warning messages
/// \param ignore_no_match: Do not warn in case no function matched
/// \p functions_regex
void generate_function_bodies(
const std::regex &functions_regex,
const generate_function_bodiest &generate_function_body,
goto_modelt &model,
message_handlert &message_handler)
message_handlert &message_handler,
bool ignore_no_match)
{
messaget messages(message_handler);
const std::regex cprover_prefix = std::regex("__CPROVER.*");
Expand All @@ -526,7 +529,7 @@ void generate_function_bodies(
function.second, model.symbol_table, function.first);
}
}
if(!did_generate_body)
if(!did_generate_body && !ignore_no_match)
{
messages.warning()
<< "generate function bodies: No function name matched regex"
Expand Down
3 changes: 2 additions & 1 deletion src/goto-instrument/generate_function_bodies.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ void generate_function_bodies(
const std::regex &functions_regex,
const generate_function_bodiest &generate_function_body,
goto_modelt &model,
message_handlert &message_handler);
message_handlert &message_handler,
bool ignore_no_match);

/// Generate a clone of \p function_name (labelled with \p call_site_id) and
/// instantiate its body with selective havocing of its parameters.
Expand Down
6 changes: 4 additions & 2 deletions src/goto-instrument/goto_instrument_parse_options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1400,7 +1400,8 @@ void goto_instrument_parse_optionst::instrument_goto_program()
std::regex(cmdline.get_value("generate-function-body")),
*generate_implementation,
goto_model,
ui_message_handler);
ui_message_handler,
false);
}

if(cmdline.isset("generate-havocing-body"))
Expand All @@ -1427,7 +1428,8 @@ void goto_instrument_parse_optionst::instrument_goto_program()
std::regex(options_split[0]),
*generate_implementation,
goto_model,
ui_message_handler);
ui_message_handler,
false);
}
else
{
Expand Down
Loading