Skip to content

Remove unnecessary __CPROVER_deallocated updates #6858

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
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
11 changes: 0 additions & 11 deletions src/ansi-c/library/stdlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,6 @@ __CPROVER_HIDE:;
// and __CPROVER_allocate doesn't, but no one cares
malloc_res = __CPROVER_allocate(alloc_size, 1);

// make sure it's not recorded as deallocated
__CPROVER_deallocated =
(malloc_res == __CPROVER_deallocated) ? 0 : __CPROVER_deallocated;

// record the object size for non-determistic bounds checking
__CPROVER_bool record_malloc = __VERIFIER_nondet___CPROVER_bool();
__CPROVER_malloc_is_new_array =
Expand Down Expand Up @@ -194,10 +190,6 @@ __CPROVER_HIDE:;
void *malloc_res;
malloc_res = __CPROVER_allocate(malloc_size, 0);

// make sure it's not recorded as deallocated
__CPROVER_deallocated =
(malloc_res == __CPROVER_deallocated) ? 0 : __CPROVER_deallocated;

// record the object size for non-determistic bounds checking
__CPROVER_bool record_malloc = __VERIFIER_nondet___CPROVER_bool();
__CPROVER_malloc_is_new_array =
Expand Down Expand Up @@ -225,9 +217,6 @@ void *__builtin_alloca(__CPROVER_size_t alloca_size)
void *res;
res = __CPROVER_allocate(alloca_size, 0);

// make sure it's not recorded as deallocated
__CPROVER_deallocated=(res==__CPROVER_deallocated)?0:__CPROVER_deallocated;

// record the object size for non-determistic bounds checking
__CPROVER_bool record_malloc=__VERIFIER_nondet___CPROVER_bool();
__CPROVER_malloc_is_new_array=record_malloc?0:__CPROVER_malloc_is_new_array;
Expand Down
6 changes: 0 additions & 6 deletions src/cpp/library/new.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ inline void *__new(__typeof__(sizeof(int)) malloc_size)
void *res;
res = __CPROVER_allocate(malloc_size, 0);

// ensure it's not recorded as deallocated
__CPROVER_deallocated=(res==__CPROVER_deallocated)?0:__CPROVER_deallocated;

// non-deterministically record the object for delete/delete[] checking
__CPROVER_bool record_malloc=__VERIFIER_nondet___CPROVER_bool();
__CPROVER_new_object = record_malloc ? res : __CPROVER_new_object;
Expand All @@ -37,9 +34,6 @@ inline void *__new_array(__CPROVER_size_t count, __CPROVER_size_t size)
void *res;
res = __CPROVER_allocate(size*count, 0);

// ensure it's not recorded as deallocated
__CPROVER_deallocated=(res==__CPROVER_deallocated)?0:__CPROVER_deallocated;

// non-deterministically record the object for delete/delete[] checking
__CPROVER_bool record_malloc=__VERIFIER_nondet___CPROVER_bool();
__CPROVER_new_object = record_malloc ? res : __CPROVER_new_object;
Expand Down