Files
codeql/cpp/ql/examples/snippets/addressof.ql
2019-07-26 17:47:11 +02:00

17 lines
395 B
Plaintext

/**
* @id cpp/examples/addressof
* @name Address of reference variable
* @description Finds address-of expressions (`&`) that take the address
* of a reference variable
* @tags addressof
* reference
*/
import cpp
from AddressOfExpr addr, VariableAccess access
where
access = addr.getOperand() and
access.getTarget().getType() instanceof ReferenceType
select addr