Skip to content

Commit 6191efe

Browse files
committed
Add option --min-null-tree-depth to cbmc
1 parent 961b072 commit 6191efe

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

src/cbmc/cbmc_parse_options.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -925,6 +925,8 @@ void cbmc_parse_optionst::help()
925925
" --round-to-zero rounding towards zero\n"
926926
" --max-nondet-tree-depth N limit size of nondet (e.g. input) object tree;\n" /* NOLINT(*) */ \
927927
" at level N references are set to null\n" /* NOLINT(*) */ \
928+
" --min-null-tree-depth N minimum level at which a pointer can first be\n" /* NOLINT(*) */ \
929+
" NULL in a recursively nondet initialized struct\n" /* NOLINT(*) */ \
928930
HELP_FUNCTIONS
929931
"\n"
930932
"Program representations:\n"

src/cbmc/cbmc_parse_options.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ class optionst;
7575
"(localize-faults)(localize-faults-method):" \
7676
OPT_GOTO_TRACE \
7777
"(max-nondet-tree-depth):" \
78+
"(min-null-tree-depth):" \
7879
"(claim):(show-claims)(floatbv)(all-claims)(all-properties)" // legacy, and will eventually disappear // NOLINT(whitespace/line_length)
7980
// clang-format on
8081

src/util/object_factory_parameters.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ void object_factory_parameterst::set(const optionst &options)
2323
max_nondet_tree_depth =
2424
options.get_unsigned_int_option("max-nondet-tree-depth");
2525
}
26+
if(options.is_set("min-null-tree-depth"))
27+
{
28+
min_null_tree_depth =
29+
options.get_unsigned_int_option("min-null-tree-depth");
30+
}
2631
if(options.is_set("max-nondet-string-length"))
2732
{
2833
max_nondet_string_length =
@@ -54,6 +59,11 @@ void parse_object_factory_options(const cmdlinet &cmdline, optionst &options)
5459
options.set_option(
5560
"max-nondet-tree-depth", cmdline.get_value("max-nondet-tree-depth"));
5661
}
62+
if(cmdline.isset("min-null-tree-depth"))
63+
{
64+
options.set_option(
65+
"min-null-tree-depth", cmdline.get_value("min-null-tree-depth"));
66+
}
5767
if(cmdline.isset("max-nondet-string-length"))
5868
{
5969
options.set_option(

0 commit comments

Comments
 (0)