]> andersk Git - splint.git/blame - test/null4.c
noexpand always false.
[splint.git] / test / null4.c
CommitLineData
885824d3 1# include "bool.h"
2
3/*@only@*/ /*@null@*/ int *p;
4
5extern /*@truenull@*/ bool isNull (/*@null@*/ int *p);
6
7void f (void)
8{
9 if (p != NULL) return;
10 else
11 {
12 p = malloc (24);
13 if (p == NULL) exit (EXIT_FAILURE);
14 *p = 3;
15 }
16}
17
18void f1 (void)
19{
20 if (p != NULL) return;
21
22 p = malloc (24);
23 if (p == NULL) exit (EXIT_FAILURE);
24 *p = 3;
25}
26
27int f2 (void)
28{
29 if (p == NULL) return 0;
30 return *p;
31}
32
33int f3 (void)
34{
35 if (isNull(p)) return 0;
36 return *p;
37}
38
39void g (void)
40{
41 if (p == NULL) return;
42
43 p = malloc (24); /* 1. Only storage p not released before assignment */
44 if (p == NULL) exit (EXIT_FAILURE);
45 *p = 3;
46}
47
This page took 0.130582 seconds and 5 git commands to generate.