/* Commandline execution: * civl verify pointersBad.cvl * */ #include #include $output int out; $input int x; $input int *x_ptr; void main() { int a; int* b, *c; int * nilPtr = NULL; c = (void *)(-1); b = (int *)malloc(sizeof(int)); free(b); $choose { $when(x == 3) {a = *(&out);} $when(x == 2) {a = *x_ptr;} $when(x == 1) {c = &a + 1; a = *c;} $when(x == 0) {a = *c;} $when(x >= 4) {a = *b;} $when(x < 0) {a = *nilPtr;} } }