Files
codeql/cpp/ql/test/library-tests/rangeanalysis/RangeSSA/RangeSsaUniqueness.ql
2018-08-02 17:53:23 +01:00

18 lines
507 B
Plaintext

/**
* @name SSA unique definition test
* @description SSA unique definition test. For each use there must be zero or one SSA definitions.
* @kind test
*/
import cpp
import semmle.code.cpp.rangeanalysis.RangeSSA
/* Count of number of uses where the number of SSA definitions exceeds one.
Should always be zero *regardless* of the input */
select
count(RangeSsaDefinition d1, RangeSsaDefinition d2, Expr u, LocalScopeVariable v |
d1.getAUse(v) = u and
d2.getAUse(v) = u and not d1 = d2
)