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

21 lines
385 B
C++

struct Foo
{
Foo(int x, int y) : m_x(x), m_y(y) {}
~Foo() {m_x = m_y = 0;}
// NB: In Microsoft mode, size_t is predeclared.
static void* operator new(size_t sz, int z, int w) { return nullptr; }
static void operator delete(void* self) {}
int m_x;
int m_y;
};
int main()
{
auto foo = new(11, 22) Foo(33, 44);
delete foo;
}
// semmle-extractor-options: --microsoft