mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
Minor refactor
This commit is contained in:
@@ -23,13 +23,14 @@ class SourceVariable = LocalVariable;
|
||||
*/
|
||||
predicate variableWrite(BasicBlock bb, int i, SourceVariable v, boolean certain) {
|
||||
(
|
||||
// We consider the `self` variable to have a single write at the entry to a method block...
|
||||
v.(SelfVariable).getDeclaringScope() = bb.(BasicBlocks::EntryBasicBlock).getScope() and
|
||||
i = 0
|
||||
or
|
||||
// ...or a class or module block.
|
||||
bb.getNode(i).getNode() =
|
||||
v.(SelfVariable).getDeclaringScope().(ModuleBase).getAControlFlowEntryNode()
|
||||
exists(Scope scope | scope = v.(SelfVariable).getDeclaringScope() |
|
||||
// We consider the `self` variable to have a single write at the entry to a method block...
|
||||
scope = bb.(BasicBlocks::EntryBasicBlock).getScope() and
|
||||
i = 0
|
||||
or
|
||||
// ...or a class or module block.
|
||||
bb.getNode(i).getNode() = scope.(ModuleBase).getAControlFlowEntryNode()
|
||||
)
|
||||
or
|
||||
SsaImpl::uninitializedWrite(bb, i, v)
|
||||
or
|
||||
|
||||
Reference in New Issue
Block a user