Skip to content

Object factory string options parsing fixes #3816

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

Merged
Merged
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
29 changes: 11 additions & 18 deletions jbmc/src/jbmc/jbmc_parse_options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,34 +251,27 @@ void jbmc_parse_optionst::get_command_line_options(optionst &options)
if(cmdline.isset("no-refine-strings"))
options.set_option("refine-strings", false);

if(cmdline.isset("string-printable"))
if(cmdline.isset("string-printable") && cmdline.isset("no-refine-strings"))
{
if(cmdline.isset("no-refine-strings"))
{
warning() << "--string-printable ignored due to --no-refine-strings"
<< eom;
}
options.set_option("string-printable", true);
throw invalid_command_line_argument_exceptiont(
"cannot use --string-printable with --no-refine-strings",
"--string-printable");
}

if(cmdline.isset("string-input-value"))
if(cmdline.isset("string-input-value") && cmdline.isset("no-refine-strings"))
{
if(cmdline.isset("no-refine-strings"))
{
warning() << "--string-input-value ignored due to --no-refine-strings"
<< eom;
}
options.set_option(
"string-input-value",
cmdline.get_values("string-input-value"));
throw invalid_command_line_argument_exceptiont(
"cannot use --string-input-value with --no-refine-strings",
"--string-input-value");
}

if(
cmdline.isset("no-refine-strings") &&
cmdline.isset("max-nondet-string-length"))
{
warning() << "--max-nondet-string-length ignored due to "
<< "--no-refine-strings" << eom;
throw invalid_command_line_argument_exceptiont(
"cannot use --max-nondet-string-length with --no-refine-strings",
"--max-nondet-string-length");
}

if(cmdline.isset("max-node-refinement"))
Expand Down
7 changes: 6 additions & 1 deletion src/util/object_factory_parameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,15 @@ void parse_object_factory_options(const cmdlinet &cmdline, optionst &options)
}
if(cmdline.isset("string-printable"))
{
options.set_option("string-printable", cmdline.isset("string-printable"));
options.set_option("string-printable", true);
}
if(cmdline.isset("string-non-empty"))
{
options.set_option("min-nondet-string-length", 1);
}
if(cmdline.isset("string-input-value"))
{
options.set_option(
"string-input-value", cmdline.get_values("string-input-value"));
}
}