Skip to content

Commit a06fc5f

Browse files
committed
Use malloc-fail-null as the default model configuration
1 parent 9a623e8 commit a06fc5f

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

Diff for: src/util/config.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -1126,7 +1126,10 @@ bool configt::set(const cmdlinet &cmdline)
11261126
if(cmdline.isset("malloc-fail-assert"))
11271127
ansi_c.malloc_failure_mode = ansi_c.malloc_failure_mode_assert_then_assume;
11281128

1129-
ansi_c.malloc_may_fail = cmdline.isset("malloc-may-fail");
1129+
if(cmdline.isset("malloc-may-fail"))
1130+
{
1131+
ansi_c.malloc_may_fail = true;
1132+
}
11301133
if(cmdline.isset("no-malloc-fail"))
11311134
{
11321135
ansi_c.malloc_may_fail = false;

Diff for: src/util/config.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ class configt
272272
libt lib;
273273
274274
bool string_abstraction;
275-
bool malloc_may_fail = false;
275+
bool malloc_may_fail = true;
276276
277277
enum malloc_failure_modet
278278
{
@@ -281,7 +281,7 @@ class configt
281281
malloc_failure_mode_assert_then_assume = 2
282282
};
283283
284-
malloc_failure_modet malloc_failure_mode = malloc_failure_mode_none;
284+
malloc_failure_modet malloc_failure_mode = malloc_failure_mode_return_null;
285285
286286
static const std::size_t default_object_bits = 8;
287287

0 commit comments

Comments
 (0)