Skip to content

Commit 52c510b

Browse files
committed
Use shared getScope instead of getRoot
1 parent b2f8782 commit 52c510b

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

go/ql/lib/semmle/go/controlflow/BasicBlocks.qll

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,7 @@ private module Input implements BB::InputSig<Location> {
4242

4343
private module BbImpl = BB::Make<Location, Input>;
4444

45-
class BasicBlock extends BbImpl::BasicBlock {
46-
/** Gets the innermost function or file to which this basic block belongs. */
47-
ControlFlow::Root getRoot() { result = this.getScope() }
48-
}
45+
class BasicBlock = BbImpl::BasicBlock;
4946

5047
class EntryBasicBlock = BbImpl::EntryBasicBlock;
5148

go/ql/lib/semmle/go/dataflow/SSA.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ class SsaDefinition extends TSsaDefinition {
144144
abstract string prettyPrintRef();
145145

146146
/** Gets the innermost function or file to which this SSA definition belongs. */
147-
ControlFlow::Root getRoot() { result = this.getBasicBlock().getRoot() }
147+
ControlFlow::Root getRoot() { result = this.getBasicBlock().getScope() }
148148

149149
/** Gets a textual representation of this element. */
150150
string toString() { result = this.prettyPrintDef() }

go/ql/lib/semmle/go/dataflow/SsaImpl.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,15 @@ private module Internal {
8686

8787
/** Holds if the `i`th node of `bb` in function `f` is an entry node. */
8888
private predicate entryNode(FuncDef f, ReachableBasicBlock bb, int i) {
89-
f = bb.getRoot() and
89+
f = bb.getScope() and
9090
bb.getNode(i).isEntryNode()
9191
}
9292

9393
/**
9494
* Holds if the `i`th node of `bb` in function `f` is a function call.
9595
*/
9696
private predicate callNode(FuncDef f, ReachableBasicBlock bb, int i) {
97-
f = bb.getRoot() and
97+
f = bb.getScope() and
9898
bb.getNode(i).(IR::EvalInstruction).getExpr() instanceof CallExpr
9999
}
100100

0 commit comments

Comments
 (0)