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.
11 lines
257 B
C++
11 lines
257 B
C++
// Two semantically equivalent abs implementations. Same signature, different
|
|
// AST shape (if/else vs ternary). Should fire the Type-4 detector.
|
|
|
|
int abs_a(int x) {
|
|
if (x < 0) return -x;
|
|
return x;
|
|
}
|
|
|
|
int abs_b(int y) {
|
|
return y < 0 ? -y : y;
|
|
}
|