source:
CIVL/examples/mem/writeset/ws_push_pop_memcpy-bad.cvl@
aaa9c8d
| Last change on this file since aaa9c8d was da65ee2, checked in by , 7 years ago | |
|---|---|
|
|
| File size: 350 bytes | |
| Line | |
|---|---|
| 1 | #include <mem.cvh> |
| 2 | #include <string.h> |
| 3 | $input int N, n; |
| 4 | $assume(N > n && n > 5); |
| 5 | |
| 6 | int main() { |
| 7 | double a[10], b[10][10]; |
| 8 | int x; |
| 9 | |
| 10 | $write_set_push(); |
| 11 | a[3] = 0; |
| 12 | b[1][3] = 0; |
| 13 | memcpy(&a[1], &a[2], sizeof(double) * 3); |
| 14 | memcpy(&b[1][0], &a[0], sizeof(double) * 3); |
| 15 | |
| 16 | $mem m = $write_set_pop(); |
| 17 | |
| 18 | $assert($mem_contains(m, &x)); |
| 19 | return 0; |
| 20 | } |
Note:
See TracBrowser
for help on using the repository browser.
