Minor refactor

This commit is contained in:
Harry Maclean
2021-10-22 11:44:38 +01:00
parent aa8607009b
commit 87df3a0a99

View File

@@ -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