mirror of
https://github.com/github/codeql.git
synced 2026-05-01 11:45:14 +02:00
C++: Delete library-tests/qlcfg/cfg.ql
This test was intended to catch regressions in the CFG, but it looks like it's just catching insignificant extractor changes. The test has started failing after some recent extractor changes, but I have no way to pinpoint the failure and understand whether it's a problem or not, so I think it's better to delete this test. The remaining tests check whether the QL-based CFG generates the same graph as the extractor-based CFG. Furthermore, the `successor-tests` check that the extractor-based CFG works as intended.
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -1,35 +0,0 @@
|
||||
// query-type: graph
|
||||
import cpp
|
||||
import semmle.code.cpp.controlflow.internal.CFG
|
||||
|
||||
class DestructorCallEnhanced extends DestructorCall {
|
||||
override string toString() {
|
||||
if exists(this.getQualifier().(VariableAccess).getTarget().getName())
|
||||
then result = "call to " + this.getQualifier().(VariableAccess).getTarget().getName() + "." + this.getTarget().getName()
|
||||
else result = super.toString()
|
||||
}
|
||||
}
|
||||
|
||||
string scope(ControlFlowNode x) {
|
||||
if exists(x.getControlFlowScope().getQualifiedName())
|
||||
then result = x.getControlFlowScope().getQualifiedName()
|
||||
else result = "<no scope>"
|
||||
}
|
||||
|
||||
predicate isNode(boolean isEdge, ControlFlowNode x, ControlFlowNode y, string label) {
|
||||
isEdge = false and x = y and label = x.toString()
|
||||
}
|
||||
|
||||
predicate isSuccessor(boolean isEdge, ControlFlowNode x, ControlFlowNode y, string label) {
|
||||
exists(string truelabel, string falselabel |
|
||||
isEdge = true
|
||||
and qlCFGSuccessor(x, y)
|
||||
and if qlCFGTrueSuccessor(x, y) then truelabel = "T" else truelabel = ""
|
||||
and if qlCFGFalseSuccessor(x, y) then falselabel = "F" else falselabel = ""
|
||||
and label = truelabel + falselabel)
|
||||
}
|
||||
|
||||
from boolean isEdge, ControlFlowNode x, ControlFlowNode y, string label
|
||||
where isNode(isEdge, x, y, label) or isSuccessor(isEdge, x, y, label)
|
||||
select scope(x), isEdge, x, y, label
|
||||
|
||||
Reference in New Issue
Block a user