Skip to content

Commit cfc3277

Browse files
committed
Reword documentation of __CPROVER_{r,w,rw}_ok
It is safe to use these primitives for asserting validity of pointers. Fixes: #8217, #8199
1 parent a209b44 commit cfc3277

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

doc/cprover-manual/memory-primitives.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -233,11 +233,11 @@ number of bytes:
233233
- `_Bool __CPROVER_w_ok(const void *p, size_t size)`
234234
235235
At present, both primitives are equivalent as all memory in CBMC is considered
236-
both readable and writeable. If `p` is the null pointer, the primitives return
237-
false. If `p` is valid, the primitives return true if the memory segment
238-
starting at the pointer has at least the given size, and false otherwise. If `p`
239-
is neither null nor valid, the semantics is unspecified. It is valid to apply
240-
the primitive to pointers that point to within a memory object. For example:
236+
both readable and writeable. The primitives return true if `p` points to a live
237+
object and the object that `p` points into extends to at least `size` more
238+
bytes. Else, an assertion encompassing the primitive will be reported to fail.
239+
Do not use these primitives in assumptions when `p` can be not valid as such use
240+
can yield spurious verification results.
241241
242242
```C
243243
char *p = malloc(10);

0 commit comments

Comments
 (0)