Skip to content

Commit

Permalink
Merge pull request #8045 from tautschnig/bugfixes/7866-bounds
Browse files Browse the repository at this point in the history
DFCC instrumentation: ensure programs are well-formed
  • Loading branch information
tautschnig authored Nov 18, 2023
2 parents 7d3c5c4 + 91380f4 commit 5cfcbc4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/pull-request-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ jobs:
echo "CCACHE_BASEDIR=$PWD" >> $GITHUB_ENV
echo "CCACHE_DIR=$PWD/.ccache" >> $GITHUB_ENV
- name: Configure using CMake
run: cmake -S . -Bbuild -G Ninja -DCMAKE_BUILD_TYPE=Release
run: cmake -S . -Bbuild -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=-Wp,-D_GLIBCXX_ASSERTIONS
- name: Zero ccache stats and limit in size
run: ccache -z --max-size=500M
- name: Build with Ninja
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -578,11 +578,15 @@ void dfcc_wrapper_programt::encode_requires_clauses()
memory_predicates.fix_calls(requires_program);

// instrument for side effects
// make the program well-formed
requires_program.add(goto_programt::make_end_function());
instrument.instrument_goto_program(
wrapper_id,
requires_program,
addr_of_requires_write_set,
function_pointer_contracts);
// turn it back into a sequence of statements
requires_program.instructions.back().turn_into_skip();

// append resulting program to preconditions section
preconditions.destructive_append(requires_program);
Expand Down Expand Up @@ -637,11 +641,15 @@ void dfcc_wrapper_programt::encode_ensures_clauses()
memory_predicates.fix_calls(ensures_program);

// instrument for side effects
// make the program well-formed
ensures_program.add(goto_programt::make_end_function());
instrument.instrument_goto_program(
wrapper_id,
ensures_program,
addr_of_ensures_write_set,
function_pointer_contracts);
// turn it back into a sequence of statements
ensures_program.instructions.back().turn_into_skip();

// add the ensures program to the postconditions section
postconditions.destructive_append(ensures_program);
Expand Down

0 comments on commit 5cfcbc4

Please sign in to comment.