Skip to content

Commit 1db8370

Browse files
authored
Merge pull request #22768 from aschackmull/unified/cfg-labeledstmt
Unified: Use the shared lib handling of LabeledStmt.
2 parents 1339778 + 042eefc commit 1db8370

1 file changed

Lines changed: 2 additions & 13 deletions

File tree

‎unified/ql/lib/codeql/unified/internal/ControlFlowGraph.qll‎

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,7 @@ module Ast implements AstSig<Location> {
132132

133133
class ContinueStmt = U::ContinueExpr;
134134

135-
class LabeledStmt extends Stmt {
136-
LabeledStmt() { none() }
137-
138-
Stmt getStmt() { none() }
139-
}
135+
class LabeledStmt = U::LabeledStmt;
140136

141137
class GotoStmt extends Stmt {
142138
GotoStmt() { none() }
@@ -253,15 +249,8 @@ private module Input implements InputSig1, InputSig2 {
253249
string toString() { result = this }
254250
}
255251

256-
private Label getLabelOfStmt(Stmt s) {
257-
exists(LabeledStmt l | s = l.getStmt() |
258-
result = l.getLabelName() or
259-
result = getLabelOfStmt(l)
260-
)
261-
}
262-
263252
predicate hasLabel(Ast::AstNode n, Label l) {
264-
l = getLabelOfStmt(n)
253+
l = n.(LabeledStmt).getLabelName()
265254
or
266255
l = n.(BreakExpr).getLabelName()
267256
or

0 commit comments

Comments
 (0)