mirror of
https://github.com/github/codeql.git
synced 2026-04-28 10:15:14 +02:00
22 lines
570 B
Plaintext
22 lines
570 B
Plaintext
import default
|
|
import semmle.code.cpp.ir.implementation.aliased_ssa.internal.AliasAnalysis
|
|
import semmle.code.cpp.ir.implementation.unaliased_ssa.IR
|
|
|
|
predicate shouldEscape(IRAutomaticUserVariable var) {
|
|
exists(string name |
|
|
name = var.getVariable().getName() and
|
|
name.matches("no_%")
|
|
)
|
|
}
|
|
|
|
from IRAutomaticUserVariable var
|
|
where
|
|
exists(IRFunction irFunc |
|
|
irFunc = var.getEnclosingIRFunction() and
|
|
(
|
|
(shouldEscape(var) and variableAddressEscapes(var)) or
|
|
(not shouldEscape(var) and not variableAddressEscapes(var))
|
|
)
|
|
)
|
|
select var
|