Files
codeql/csharp/ql/test/library-tests/dataflow/ssa/SSAPhiRead.ql
2022-11-15 11:45:32 +01:00

18 lines
558 B
Plaintext

import csharp
import semmle.code.csharp.dataflow.internal.SsaImpl
import ExposedForTestingOnly
query predicate phiReadNode(PhiReadNode phi, Ssa::SourceVariable v) { phi.getSourceVariable() = v }
query predicate phiReadNodeRead(PhiReadNode phi, Ssa::SourceVariable v, ControlFlow::Node read) {
phi.getSourceVariable() = v and
exists(ControlFlow::BasicBlock bb, int i |
ssaDefReachesReadExt(v, phi, bb, i) and
read = bb.getNode(i)
)
}
query predicate phiReadInput(PhiReadNode phi, DefinitionExt inp) {
phiHasInputFromBlockExt(phi, inp, _)
}