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

29 lines
575 B
C++

extern "C++" {
namespace std {
typedef unsigned long size_t;
}
void* operator new(std::size_t);
void* operator new[](std::size_t);
void operator delete(void*);
void operator delete[](void*);
}
class C_with_constr_destr {
public:
C_with_constr_destr() { };
~C_with_constr_destr() { };
};
void f_with_op(int i) {
char *c = new char;
char *buf1 = new char[500];
char *buf2 = new char[500 + i];
delete[] buf2;
delete[] buf1;
delete c;
C_with_constr_destr *cd = new C_with_constr_destr;
delete cd;
}