Skip to content

Commit ea83bc9

Browse files
committed
Remove handling of malloc-may-fail.
It will be handled in next PR.
1 parent 4ba1d14 commit ea83bc9

File tree

2 files changed

+0
-42
lines changed

2 files changed

+0
-42
lines changed

src/cbmc/cbmc_parse_options.cpp

-20
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,6 @@ void cbmc_parse_optionst::set_default_analysis_flags(
118118
options.set_option("signed-overflow-check", enabled);
119119
options.set_option("undefined-shift-check", enabled);
120120

121-
// Default malloc failure profile chosen to be returning null. These options
122-
// are not strictly needed, but they are staying here as part of documentation
123-
// of the default option set for the tool.
124-
options.set_option("malloc-may-fail", enabled);
125-
options.set_option("malloc-fail-null", enabled);
126-
127121
// Unwinding assertions required in certain cases for sound verification
128122
// results. See https://github.com/diffblue/cbmc/issues/6561 for elaboration.
129123
options.set_option("unwinding-assertions", enabled);
@@ -343,20 +337,6 @@ void cbmc_parse_optionst::get_command_line_options(optionst &options)
343337
cbmc_parse_optionst::set_default_analysis_flags(
344338
options, !cmdline.isset("no-standard-checks"));
345339

346-
if(!cmdline.isset("no-standard-checks"))
347-
{
348-
// The malloc failure mode is by default handled by the `config.set` call
349-
// which only looks at the `cmdline` flags. In the case of default checks,
350-
// these haven't been set - we need to overwrite the config object to manually
351-
// bootstrap the malloc-may-fail behaviour
352-
if(!config.ansi_c.malloc_may_fail && options.is_set("malloc-may-fail"))
353-
{
354-
config.ansi_c.malloc_may_fail = true;
355-
config.ansi_c.malloc_failure_mode =
356-
configt::ansi_ct::malloc_failure_modet::malloc_failure_mode_return_null;
357-
}
358-
}
359-
360340
// all (other) checks supported by goto_check
361341
PARSE_OPTIONS_GOTO_CHECK(cmdline, options);
362342

src/goto-analyzer/goto_analyzer_parse_options.cpp

-22
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,6 @@ void goto_analyzer_parse_optionst::set_default_analysis_flags(
6868
options.set_option("signed-overflow-check", enabled);
6969
options.set_option("undefined-shift-check", enabled);
7070

71-
// Default malloc failure profile chosen to be returning null. These options
72-
// are not strictly *needed*, but they are staying here as part of documentation
73-
// of the default option set for the tool.
74-
options.set_option("malloc-may-fail", enabled);
75-
options.set_option("malloc-fail-null", enabled);
76-
7771
// This is in-line with the options we set for CBMC in cbmc_parse_optionst
7872
// with the exception of unwinding-assertions, which don't make sense in
7973
// the context of abstract interpretation.
@@ -93,22 +87,6 @@ void goto_analyzer_parse_optionst::get_command_line_options(optionst &options)
9387
goto_analyzer_parse_optionst::set_default_analysis_flags(
9488
options, !cmdline.isset("no-standard-checks"));
9589

96-
// Enable flags that in combination provide analysis with no surprises
97-
// (expected checks and no unsoundness by missing checks).
98-
if(!cmdline.isset("no-standard-checks"))
99-
{
100-
// The malloc failure mode is by default handled by the `config.set` call
101-
// which only looks at the `cmdline` flags. In the case of default checks,
102-
// these haven't been set - we need to overwrite the config object to manually
103-
// bootstrap the malloc-may-fail behaviour
104-
if(!config.ansi_c.malloc_may_fail && options.is_set("malloc-may-fail"))
105-
{
106-
config.ansi_c.malloc_may_fail = true;
107-
config.ansi_c.malloc_failure_mode =
108-
configt::ansi_ct::malloc_failure_modet::malloc_failure_mode_return_null;
109-
}
110-
}
111-
11290
// all (other) checks supported by goto_check
11391
PARSE_OPTIONS_GOTO_CHECK(cmdline, options);
11492

0 commit comments

Comments
 (0)