Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// clang-format off
int *foo(int *p)
__CPROVER_requires(__CPROVER_is_fresh(p, sizeof(int)))
__CPROVER_ensures(__CPROVER_is_fresh(__CPROVER_return_value, sizeof(int)))
// clang-format on
{
return p;
}

int main()
{
int *p;
foo(p);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
CORE dfcc-only
main.c
--dfcc main --enforce-contract foo
^\[foo.postcondition.\d+\].*Check ensures clause of contract contract::foo for function foo: FAILURE$
^EXIT=10$
^SIGNAL=0$
^VERIFICATION FAILED$
--
--
This test checks that __CPROVER_is_fresh separation checks fail when the
return value aliases with a parameter that was required to be fresh.
Original file line number Diff line number Diff line change
Expand Up @@ -903,7 +903,7 @@ const code_function_callt dfcc_libraryt::ptr_pred_ctx_reset_call(
const source_locationt &source_location)
{
code_function_callt call(
dfcc_fun_symbol[dfcc_funt::PTR_PRED_CTX_INIT].symbol_expr(),
dfcc_fun_symbol[dfcc_funt::PTR_PRED_CTX_RESET].symbol_expr(),
{ptr_pred_ctx_ptr});
call.add_source_location() = source_location;
return call;
Expand Down
Loading