Skip to content

Commit 2746997

Browse files
authored
Merge pull request #3816 from danpoe/fixes/object-factory-string-input-options
Object factory string options parsing fixes
2 parents 1c12543 + a9a170c commit 2746997

File tree

2 files changed

+17
-19
lines changed

2 files changed

+17
-19
lines changed

jbmc/src/jbmc/jbmc_parse_options.cpp

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -251,34 +251,27 @@ void jbmc_parse_optionst::get_command_line_options(optionst &options)
251251
if(cmdline.isset("no-refine-strings"))
252252
options.set_option("refine-strings", false);
253253

254-
if(cmdline.isset("string-printable"))
254+
if(cmdline.isset("string-printable") && cmdline.isset("no-refine-strings"))
255255
{
256-
if(cmdline.isset("no-refine-strings"))
257-
{
258-
warning() << "--string-printable ignored due to --no-refine-strings"
259-
<< eom;
260-
}
261-
options.set_option("string-printable", true);
256+
throw invalid_command_line_argument_exceptiont(
257+
"cannot use --string-printable with --no-refine-strings",
258+
"--string-printable");
262259
}
263260

264-
if(cmdline.isset("string-input-value"))
261+
if(cmdline.isset("string-input-value") && cmdline.isset("no-refine-strings"))
265262
{
266-
if(cmdline.isset("no-refine-strings"))
267-
{
268-
warning() << "--string-input-value ignored due to --no-refine-strings"
269-
<< eom;
270-
}
271-
options.set_option(
272-
"string-input-value",
273-
cmdline.get_values("string-input-value"));
263+
throw invalid_command_line_argument_exceptiont(
264+
"cannot use --string-input-value with --no-refine-strings",
265+
"--string-input-value");
274266
}
275267

276268
if(
277269
cmdline.isset("no-refine-strings") &&
278270
cmdline.isset("max-nondet-string-length"))
279271
{
280-
warning() << "--max-nondet-string-length ignored due to "
281-
<< "--no-refine-strings" << eom;
272+
throw invalid_command_line_argument_exceptiont(
273+
"cannot use --max-nondet-string-length with --no-refine-strings",
274+
"--max-nondet-string-length");
282275
}
283276

284277
if(cmdline.isset("max-node-refinement"))

src/util/object_factory_parameters.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,15 @@ void parse_object_factory_options(const cmdlinet &cmdline, optionst &options)
7676
}
7777
if(cmdline.isset("string-printable"))
7878
{
79-
options.set_option("string-printable", cmdline.isset("string-printable"));
79+
options.set_option("string-printable", true);
8080
}
8181
if(cmdline.isset("string-non-empty"))
8282
{
8383
options.set_option("min-nondet-string-length", 1);
8484
}
85+
if(cmdline.isset("string-input-value"))
86+
{
87+
options.set_option(
88+
"string-input-value", cmdline.get_values("string-input-value"));
89+
}
8590
}

0 commit comments

Comments
 (0)