Files
codeql/cpp/ql/test/library-tests/qlcfg/ms_assume.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

35 lines
573 B
C++

// semmle-extractor-options: --microsoft
char *Xstrdup(const char *string);
void abort();
struct FILE;
char *fgets(char *str, int num, FILE *stream);
int ignore_return_value();
#define IGNORE_RETURN_VALUE() ignore_return_value()
void myIgnoreReturnValue();
int main(int argc, char *argv[])
{
char *s1 = Xstrdup("Hello, world!");
char *s2 = Xstrdup(0);
if (argc == 0)
{
abort();
} else if (argc == 1) {
__assume(0);
}
{
char buffer[256];
char *result;
FILE *s;
result = fgets(buffer, 256, s);
}
IGNORE_RETURN_VALUE();
myIgnoreReturnValue();
}