Clang LibTooling + Z3 BV-64 encoding. 11 detectors: clone, equiv, class-dup, dead, null-deref, div-by-zero, int-overflow, oob, int-truncation, sign-conversion, taint-track. Interfaces: CLI, MCP (JSON-RPC 2.0), LSP. Output: SARIF 2.1.0, JSON, Markdown.
14 lines
335 B
C++
14 lines
335 B
C++
// Two classes with the same method signatures and bodies that compute
|
|
// equivalent values. Class-dup detector should flag.
|
|
|
|
class CalcA {
|
|
public:
|
|
int twice(int x) { return x + x; }
|
|
int square(int x) { return x * x; }
|
|
};
|
|
|
|
class CalcB {
|
|
public:
|
|
int twice(int y) { return y * 2; }
|
|
int square(int y) { return y * y; }
|
|
};
|