source: CIVL/examples/languageFeatures/pointersBad.cvl@ 01e5f885

1.23 2.0 main test-branch
Last change on this file since 01e5f885 was 19d1808f, checked in by Ziqing Luo <ziqing@…>, 11 years ago

tests cover more

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

  • Property mode set to 100644
File size: 394 bytes
Line 
1/* Commandline execution:
2 * civl verify pointersBad.cvl
3 * */
4#include<civlc.cvh>
5#include<stdlib.h>
6
7$output int out;
8$input int *x_ptr;
9void main() {
10 int a;
11 int* b, *c;
12 int * nilPtr = NULL;
13
14 c = (void *)(-1);
15 b = (int *)malloc(sizeof(int));
16 free(b);
17 $choose {
18 {a = *(&out);}
19 {a = *x_ptr;}
20 {c = &a + 1; a = *c;}
21 {a = *c;}
22 {a = *b;}
23 {a = *nilPtr;}
24 }
25}
Note: See TracBrowser for help on using the repository browser.