source: CIVL/examples/concurrency/pointerShare2.cvl@ cf2a996

1.23 2.0 main test-branch
Last change on this file since cf2a996 was 2e23cba, checked in by Manchun Zheng <zmanchun@…>, 12 years ago

fixed the bug in the new POR that fails to check dereference of pointers. Added sharePointer2.cvl, an exmple that has pointer to a heap object.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@598 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 228 bytes
Line 
1#include<civlc.h>
2int *x;
3int *p;
4$heap h;
5
6void f() {
7 int y=0;
8 {
9 int *q = p;
10 y = y + 1;
11 *q = 15;
12 }
13}
14
15void main() {
16 x = (int*) $malloc(&h, sizeof(int));
17 p = x;
18 *x = 0;
19 $spawn f();
20 $assert(*p==0);
21}
Note: See TracBrowser for help on using the repository browser.