forked from github/codeql
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.cpp
More file actions
50 lines (39 loc) · 639 Bytes
/
test.cpp
File metadata and controls
50 lines (39 loc) · 639 Bytes
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
typedef int jmp_buf;
void longjmp(jmp_buf env, int val);
[[noreturn]]
void noReturn0();
void noReturn1() {
noReturn0();
}
void noReturn2() {
do {
noReturn0();
}
while (0);
}
void noReturn3(int i) {
if (i > 0) {
noReturn1();
} else {
noReturn2();
}
}
void noReturn4() {
while (true) { }
}
void mayReturn(int i) {
if (i > 0) {
noReturn0();
}
}
#define mayReturnMacro(i) \
do { if (i > 0) { noReturn0(); } } while (0);
void noReturn5() {
mayReturnMacro(1);
}
void noReturn6() {
longjmp(0, 0);
}
void noReturn7() { // NOT REPORTED
throw 42;
}