-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathspec_sum.c
82 lines (52 loc) · 1.71 KB
/
spec_sum.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#define SW_CHANNEL_MIN_MEM (1024*64)
// resource Leak
/*@ open(path):
Future (((ret>0)/\(!(ret=stdout)/\!(ret=stdin))), (!close(ret))^* · close(ret) · (_)^*)@*/
/*@ socket(domain, type, protocol):
Future ((ret>0), (!close(ret))^* · close(ret) · (_)^*)@*/
/*@ close(handler):
Post (TRUE, close(handler))@*/
/*@ fopen(path):
Future (((ret>0)/\(!(ret=stdout)/\!(ret=stdin))), (!fclose(ret))^* · fclose(ret) · (_)^*)@*/
/*@ fclose(handler):
Post (TRUE, fclose(handler))@*/
/*@ fdopen(path, b):
Post (TRUE, CONSUME(path))
Future (((ret>0)/\(!(ret=stdout)/\!(ret=stdin))), ((!fclose(ret))^* · fclose(ret) · (_)^* \/ (!close(path))^* · close(path) · (_)^*))@*/
/*@ endmntent(handler):
Post (TRUE, fclose(handler))@*/
/*@ fflush(handler):
Post (TRUE, fclose(handler))@*/
/*@ opendir(path):
Future ((ret>0), (!closedir(ret))^* · closedir(ret) · (_)^*)@*/
/*@ closedir(handler):
Post (TRUE, closedir(handler))@*/
/*@ rpl_open(path):
Future ((ret>0), (!close(ret))^* · close(ret) · (_)^*)@*/
// NPD
/*@ assignnullsyh():
Future (ret=0, (!_(ret))^*) @*/
/*@ localtime(t):
Future ((ret=0), (!_(ret))^*)@*/
/*@ malloc(path):
Future ((ret=0), (!_(ret))^*)@*/
/*@ realloc(a, b):
Future ((ret=0), (!_(ret))^*)@*/
/*@ calloc(path):
Future ((ret=0), (!_(ret))^*)@*/
/*@ free(handler):
Post (TRUE, free(handler))@*/
/*@ strcmp(a, b):
Post (TRUE, strcmp(a))@*/
/*@ fputs(a, b):
Post (TRUE, fputs(b))@*/
/*@ memset(a, b):
Post (TRUE, memset(a))@*/
/*@ memcpy(a, b):
Post (TRUE, memcpy(a))@*/
/*@ strcpy(a, b):
Post (TRUE, strcpy(a)) @*/
/*@ strlen(a):
Post (TRUE, strlen(a))@*/
/*@ sprintf(a, b, c):
Post (TRUE, sprintf(a))@*/