Skip to content

Commit d8a3286

Browse files
authored
Merge pull request #7305 from tautschnig/bugfixes/dfcc-segv
Contracts/DFCC: do not access invalidated references
2 parents 91ea53f + d2d3142 commit d8a3286

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/goto-instrument/contracts/dynamic-frames/dfcc_is_freeable.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ void dfcc_is_freeablet::rewrite_calls(
5555
.set_identifier(library.get_dfcc_fun_name(dfcc_funt::IS_FREEABLE));
5656
target->call_arguments().push_back(write_set);
5757
}
58-
59-
if(fun_name == CPROVER_PREFIX "was_freed")
58+
else if(fun_name == CPROVER_PREFIX "was_freed")
6059
{
6160
// insert call to precondition for vacuity checking
6261
auto inst = goto_programt::make_function_call(

src/goto-instrument/contracts/dynamic-frames/dfcc_library.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,8 +454,7 @@ void dfcc_libraryt::fix_malloc_free_calls()
454454

455455
if(fun_name == (CONTRACTS_PREFIX "malloc"))
456456
to_symbol_expr(ins->call_function()).set_identifier("malloc");
457-
458-
if(fun_name == (CONTRACTS_PREFIX "free"))
457+
else if(fun_name == (CONTRACTS_PREFIX "free"))
459458
to_symbol_expr(ins->call_function()).set_identifier("free");
460459
}
461460
}

0 commit comments

Comments
 (0)