mirror of
https://github.com/github/codeql.git
synced 2026-04-20 06:24:03 +02:00
C++: Simplify 'isGlobalUse' and 'isGlobalDefImpl'.
This commit is contained in:
@@ -143,11 +143,10 @@ private newtype TDefOrUseImpl =
|
||||
private predicate isGlobalUse(
|
||||
GlobalLikeVariable v, IRFunction f, int indirection, int indirectionIndex
|
||||
) {
|
||||
exists(VariableAddressInstruction vai, int defIndex |
|
||||
exists(VariableAddressInstruction vai |
|
||||
vai.getEnclosingIRFunction() = f and
|
||||
vai.getAstVariable() = v and
|
||||
isDef(_, _, _, vai, indirection, defIndex) and
|
||||
indirectionIndex = [0 .. defIndex] + 1
|
||||
isDef(_, _, _, vai, indirection, indirectionIndex)
|
||||
)
|
||||
}
|
||||
|
||||
@@ -158,7 +157,7 @@ private predicate isGlobalDefImpl(
|
||||
vai.getEnclosingIRFunction() = f and
|
||||
vai.getAstVariable() = v and
|
||||
isUse(_, _, vai, indirection, indirectionIndex) and
|
||||
not isDef(_, _, vai.getAUse(), _, _, _)
|
||||
not isDef(_, _, _, vai, _, indirectionIndex)
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user