Skip to content

Commit ce68d67

Browse files
authored
Merge pull request #6858 from tautschnig/cleanup/deallocated-updates
Remove unnecessary __CPROVER_deallocated updates
2 parents d3f966a + c3e05b1 commit ce68d67

File tree

2 files changed

+0
-17
lines changed

2 files changed

+0
-17
lines changed

src/ansi-c/library/stdlib.c

-11
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,6 @@ __CPROVER_HIDE:;
146146
// and __CPROVER_allocate doesn't, but no one cares
147147
malloc_res = __CPROVER_allocate(alloc_size, 1);
148148

149-
// make sure it's not recorded as deallocated
150-
__CPROVER_deallocated =
151-
(malloc_res == __CPROVER_deallocated) ? 0 : __CPROVER_deallocated;
152-
153149
// record the object size for non-determistic bounds checking
154150
__CPROVER_bool record_malloc = __VERIFIER_nondet___CPROVER_bool();
155151
__CPROVER_malloc_is_new_array =
@@ -210,10 +206,6 @@ __CPROVER_HIDE:;
210206
void *malloc_res;
211207
malloc_res = __CPROVER_allocate(malloc_size, 0);
212208

213-
// make sure it's not recorded as deallocated
214-
__CPROVER_deallocated =
215-
(malloc_res == __CPROVER_deallocated) ? 0 : __CPROVER_deallocated;
216-
217209
// record the object size for non-determistic bounds checking
218210
__CPROVER_bool record_malloc = __VERIFIER_nondet___CPROVER_bool();
219211
__CPROVER_malloc_is_new_array =
@@ -241,9 +233,6 @@ void *__builtin_alloca(__CPROVER_size_t alloca_size)
241233
void *res;
242234
res = __CPROVER_allocate(alloca_size, 0);
243235

244-
// make sure it's not recorded as deallocated
245-
__CPROVER_deallocated=(res==__CPROVER_deallocated)?0:__CPROVER_deallocated;
246-
247236
// record the object size for non-determistic bounds checking
248237
__CPROVER_bool record_malloc=__VERIFIER_nondet___CPROVER_bool();
249238
__CPROVER_malloc_is_new_array=record_malloc?0:__CPROVER_malloc_is_new_array;

src/cpp/library/new.c

-6
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ inline void *__new(__typeof__(sizeof(int)) malloc_size)
1010
void *res;
1111
res = __CPROVER_allocate(malloc_size, 0);
1212

13-
// ensure it's not recorded as deallocated
14-
__CPROVER_deallocated=(res==__CPROVER_deallocated)?0:__CPROVER_deallocated;
15-
1613
// non-deterministically record the object for delete/delete[] checking
1714
__CPROVER_bool record_malloc=__VERIFIER_nondet___CPROVER_bool();
1815
__CPROVER_new_object = record_malloc ? res : __CPROVER_new_object;
@@ -37,9 +34,6 @@ inline void *__new_array(__CPROVER_size_t count, __CPROVER_size_t size)
3734
void *res;
3835
res = __CPROVER_allocate(size*count, 0);
3936

40-
// ensure it's not recorded as deallocated
41-
__CPROVER_deallocated=(res==__CPROVER_deallocated)?0:__CPROVER_deallocated;
42-
4337
// non-deterministically record the object for delete/delete[] checking
4438
__CPROVER_bool record_malloc=__VERIFIER_nondet___CPROVER_bool();
4539
__CPROVER_new_object = record_malloc ? res : __CPROVER_new_object;

0 commit comments

Comments
 (0)