Skip to content

Go: Use shared guards library - #22365

Draft
owen-mc wants to merge 8 commits into
github:mainfrom
owen-mc:go/shared-guards
Draft

owen-mc wants to merge 8 commits into
github:mainfrom
owen-mc:go/shared-guards

Conversation

@owen-mc

@owen-mc owen-mc commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

No description provided.


/** Holds if arguments at position `apos` match parameters at position `ppos`. */
pragma[inline]
predicate parameterMatch(ParameterPosition ppos, ArgumentPosition apos) { ppos = apos }
* idiom.
*/
pragma[inline]
predicate guardEnsures(Expr e, boolean b, BasicBlock bb) { e.(Guard).controls(bb, b) }
Node g, ControlFlow::ConditionGuardNode guard, Node nd, SsaWithFields ap, P param
) {
guards(g, guard, nd, param) and nd = ap.getAUse()
private predicate guards(Node g, Guard guard, boolean branch, Node nd, SsaWithFields ap, P param) {

@github-advanced-security github-advanced-security AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

@owen-mc
owen-mc force-pushed the go/shared-guards branch 2 times, most recently from def5d61 to 888eae3 Compare August 18, 2026 11:45
private import semmle.go.dataflow.SSA as GoSsa
private import semmle.go.dataflow.SsaImpl as SsaImpl
private import codeql.controlflow.Guards as SharedGuards
private import codeql.controlflow.SuccessorType
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants