mirror of
https://github.com/github/codeql.git
synced 2026-03-28 18:28:17 +01:00
Some files that will change in #1736 have been spared. ./build -j4 target/jars/qlformat find ql/cpp/ql -name "*.ql" -print0 | xargs -0 target/jars/qlformat --input find ql/cpp/ql -name "*.qll" -print0 | xargs -0 target/jars/qlformat --input (cd ql && git checkout 'cpp/ql/src/semmle/code/cpp/ir/implementation/**/*SSA*.qll') buildutils-internal/scripts/pr-checks/sync-identical-files.py --latest
26 lines
853 B
Plaintext
26 lines
853 B
Plaintext
/**
|
|
* @name RangeSsa completeness test
|
|
* @description RangeSsa completeness test. If there is a
|
|
* RangeSsaDefinition for a variable that reaches a use of that
|
|
* variable then there must be a RangeSsaDefinition for that use
|
|
* @kind test
|
|
*/
|
|
|
|
import cpp
|
|
import semmle.code.cpp.rangeanalysis.RangeSSA
|
|
|
|
/*
|
|
* Count of number of uses of a LocalScopeVariable where no corresponding SSA definition exists,
|
|
* but at least one SSA definition for that variable can reach that use.
|
|
* Should always be zero *regardless* of the input
|
|
*/
|
|
|
|
select count(LocalScopeVariable v, Expr use |
|
|
exists(RangeSsaDefinition def, BasicBlock db, BasicBlock ub |
|
|
def.getAUse(v) = use and db.contains(def.getDefinition()) and ub.contains(use)
|
|
|
|
|
db.getASuccessor+() = ub
|
|
) and
|
|
not exists(RangeSsaDefinition def | def.getAUse(v) = use)
|
|
)
|