main
|
Last change
on this file was e429fb1, checked in by Stephen Siegel <siegel@…>, 3 years ago |
|
The creation of $mem values now is aware of memory locations inside
sequence objects. In such cases, it automatically over-approximates
the $mem value to be a memory location of the whole sequence object.
git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@5834 fb995dde-84ed-4084-dfe6-e5aef3e2452c
|
-
Property mode
set to
100644
|
|
File size:
753 bytes
|
| Line | |
|---|
| 1 | #include <mem.cvh>
|
|---|
| 2 | #include <seq.cvh>
|
|---|
| 3 |
|
|---|
| 4 | int main() {
|
|---|
| 5 | struct {
|
|---|
| 6 | int a;
|
|---|
| 7 | union UT {
|
|---|
| 8 | int b_seq[];
|
|---|
| 9 | int b_arr[10];
|
|---|
| 10 | } b;
|
|---|
| 11 | } s;
|
|---|
| 12 |
|
|---|
| 13 | $write_set_push();
|
|---|
| 14 |
|
|---|
| 15 | s.a = 0;
|
|---|
| 16 |
|
|---|
| 17 | $mem m = $write_set_pop();
|
|---|
| 18 |
|
|---|
| 19 | $assert($mem_contains(m, ($mem)&s.a) &&
|
|---|
| 20 | $mem_contains(($mem)&s.a, m));
|
|---|
| 21 |
|
|---|
| 22 | $write_set_push();
|
|---|
| 23 |
|
|---|
| 24 | s.b.b_arr[9] = 0;
|
|---|
| 25 |
|
|---|
| 26 | m = $write_set_pop();
|
|---|
| 27 |
|
|---|
| 28 | $assert($mem_contains(m, ($mem)&s.b.b_arr[9]) &&
|
|---|
| 29 | $mem_contains(($mem)&s.b.b_arr[9], m));
|
|---|
| 30 |
|
|---|
| 31 | $seq_init(&s.b.b_seq, 10, &s.a);
|
|---|
| 32 |
|
|---|
| 33 | $write_set_push();
|
|---|
| 34 |
|
|---|
| 35 | s.b.b_seq[9] = 0;
|
|---|
| 36 | s.b.b_arr[9] = 0;
|
|---|
| 37 |
|
|---|
| 38 | m = $write_set_pop();
|
|---|
| 39 |
|
|---|
| 40 | $assert($mem_contains(m, $mem_union(($mem)&s.b.b_seq,
|
|---|
| 41 | ($mem)&s.b.b_arr[9])) &&
|
|---|
| 42 | $mem_contains($mem_union(($mem)&s.b.b_seq,
|
|---|
| 43 | ($mem)&s.b.b_arr[9]),
|
|---|
| 44 | m));
|
|---|
| 45 |
|
|---|
| 46 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.