Files
codeql/cpp/ql/test/library-tests/qlcfg/abortingfunctions.cpp
Jonas Jensen 26f32f0d6d C++: Initial version of CFG.qll
This implements calculation of the control-flow graph in QL. The new
code is not enabled yet as we'll need more extractor changes first.

The `SyntheticDestructorCalls.qll` file is a temporary solution that can
be removed when the extractor produces this information directly.
2019-01-04 13:34:36 +01:00

50 lines
639 B
C++

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;
}