1int *ptr;
2int x, y, z;
3void frob(void) {
4	if ((y && !ptr) || z)
5		return;
6	if (ptr) {
7		/* in the current version of smatch this erases
8		   the old implications.  Later version should
9		   fix this.  --Dec 2 2009 */
10		x = *ptr;
11	}
12	if (!y && ptr)
13		*ptr = 0; // smatch used to print an error here.
14	if (!y)
15		*ptr = 1;
16}
17/*
18 * check-name: Dereferencing Undefined
19 * check-command: smatch sm_null_deref2.c
20 *
21 * check-output-start
22sm_null_deref2.c:15 frob() error: we previously assumed 'ptr' could be null (see line 12)
23 * check-output-end
24 */
25