Skip to content

Commit 297765b

Browse files
committed
__CPROVER_return_value in postcondtions
1 parent 3ebfca3 commit 297765b

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
KNOWNBUG
1+
CORE
22
recursive_function2.c
33

44
^EXIT=0$
55
^SIGNAL=0$
6-
^\[recursive_function\.precondition\.1] line \d+ postcondition recursive_function: SUCCESS$
6+
^\[recursive_function\.postcondition\.1] line \d+ postcondition: SUCCESS$
77
--

src/cprover/instrument_contracts.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,11 @@ void replace_function_calls_by_contracts(
283283
replace_symbol.insert(p_symbol, arguments[p]);
284284
}
285285

286+
// replace __CPROVER_return_value by the lhs of the call
287+
const auto &call_lhs = it->call_lhs();
288+
replace_symbol.insert(
289+
symbol_exprt("__CPROVER_return_value", call_lhs.type()), call_lhs);
290+
286291
for(auto &precondition : contract.requires())
287292
{
288293
auto location = it->source_location();

0 commit comments

Comments
 (0)