mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
Java: Replace remaining SsaImplicitInit.
This commit is contained in:
@@ -102,10 +102,9 @@ predicate hasNonlocalValue(FieldRead fr) {
|
||||
not exists(SsaDefinition v | v.getARead() = fr)
|
||||
or
|
||||
exists(SsaDefinition v, SsaDefinition def |
|
||||
v.getARead() = fr and def = v.getAnUltimateDefinition()
|
||||
|
|
||||
def instanceof SsaImplicitInit or
|
||||
def instanceof SsaImplicitUpdate
|
||||
v.getARead() = fr and
|
||||
def = v.getAnUltimateDefinition() and
|
||||
def instanceof SsaImplicitWrite
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -510,9 +510,9 @@ private module Cached {
|
||||
|
||||
/** Holds if `init` is a closure variable that captures the value of `capturedvar`. */
|
||||
cached
|
||||
predicate captures(SsaImplicitInit init, SsaVariable capturedvar) {
|
||||
predicate captures(SsaImplicitEntryDefinition init, SsaVariable capturedvar) {
|
||||
exists(BasicBlock bb, int i |
|
||||
Impl::ssaDefReachesRead(_, capturedvar, bb, i) and
|
||||
Ssa::ssaDefReachesUncertainRead(_, capturedvar, bb, i) and
|
||||
variableCapture(capturedvar.getSourceVariable(), init.getSourceVariable(), bb, i)
|
||||
)
|
||||
}
|
||||
|
||||
@@ -267,9 +267,8 @@ private module Impl {
|
||||
}
|
||||
|
||||
/** Gets the variable underlying the implicit SSA variable `v`. */
|
||||
Variable getImplicitSsaDeclaration(SsaVariable v) {
|
||||
result = v.(SsaImplicitUpdate).getSourceVariable().getVariable() or
|
||||
result = v.(SsaImplicitInit).getSourceVariable().getVariable()
|
||||
Variable getImplicitSsaDeclaration(SsaDefinition v) {
|
||||
result = v.(SsaImplicitWrite).getSourceVariable().getVariable()
|
||||
}
|
||||
|
||||
/** Holds if the variable underlying the implicit SSA variable `v` is not a field. */
|
||||
|
||||
Reference in New Issue
Block a user