Skip to content

Conversation

@owen-mc
Copy link
Contributor

@owen-mc owen-mc commented Jan 27, 2026

No description provided.

@github-actions github-actions bot added the Go label Jan 27, 2026
// predicate nodeIsPostDominanceExit(Node node) { node instanceof ControlFlow::NormalExitNode }
}

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

Check warning

Code scanning / CodeQL

Dead code Warning

This code is never used, and it's not publicly exported.
Comment on lines 1682 to 1716
this.succ0(pred, succ, t)
or
exists(Completion cmpl |
lastNode(this.getBody(), pred, cmpl) and
// last node of function body can be reached without going through a `defer` statement
pred = notDeferSucc0*(this.getEntry())
|
// panic goes directly to exit, non-panic reads result variables first
if cmpl = Panic() then succ = MkExitNode(this) else succ = this.getEpilogueNode(0)
(
(
if cmpl = Panic()
then succ = MkExitNode(this) and t instanceof ExceptionSuccessor
else succ = this.getEpilogueNode(0)
) and
t instanceof DirectSuccessor
)
)
or
lastNode(this.getBody(), pred, _) and
exists(DeferStmt defer | defer = this.getADeferStmt() |
succ = MkExprNode(defer.getCall()) and
// the last `DeferStmt` executed before pred is this `defer`
pred = notDeferSucc0*(MkDeferNode(defer))
)
or
exists(DeferStmt predDefer, DeferStmt succDefer |
predDefer = this.getADeferStmt() and
succDefer = this.getADeferStmt()
|
// reversed because `defer`s are executed in LIFO order
MkDeferNode(predDefer) = nextDefer(MkDeferNode(succDefer)) and
pred = MkExprNode(predDefer.getCall()) and
succ = MkExprNode(succDefer.getCall())
)
) and
t instanceof DirectSuccessor
or
this.firstDefer(pred) and
(
// conservatively assume that we might either panic (and hence skip the result reads)
// or not
succ = MkExitNode(this)
succ = MkExitNode(this) and t instanceof ExitSuccessor
or
succ = this.getEpilogueNode(0)
)

Check warning

Code scanning / CodeQL

Var only used in one side of disjunct Warning

The
variable t
is only used in one side of disjunct.
this.succ0(pred, succ, _)
}

pragma[nomagic]

Check warning

Code scanning / CodeQL

Override with unmentioned parameter Warning

Override predicate doesn't mention
t
. Maybe mention it in a 'exists(t)'?
pragma[nomagic]
override predicate succ0(ControlFlow::Node pred, ControlFlow::Node succ, SuccessorType t) {
ControlFlowTree.super.succ0(pred, succ, t)
or

Check warning

Code scanning / CodeQL

Override with unmentioned parameter Warning

Override predicate doesn't mention
t
. Maybe mention it in a 'exists(t)'?

Check warning

Code scanning / CodeQL

Dead code Warning

This code is never used, and it's not publicly exported.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant