Fix compiler errors and warnings: remove redundant type checks and isIn guards, mark implicitFieldSelection as additional

Agent-Logs-Url: https://github.com/github/codeql/sessions/8d96128c-44db-4ba1-9eca-1a5b37f54442

Co-authored-by: owen-mc <62447351+owen-mc@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-03-31 09:07:37 +00:00
committed by Owen Mansel-Chan
parent 8bd2effeff
commit ef6e973831
2 changed files with 7 additions and 7 deletions

View File

@@ -524,7 +524,7 @@ module GoCfg {
private predicate notBlankIdent(Go::Expr e) { not e instanceof Go::BlankIdent }
/** Helper: implicit field selection for promoted selectors */
predicate implicitFieldSelection(Ast::AstNode e, int index, Go::Field implicitField) {
additional predicate implicitFieldSelection(Ast::AstNode e, int index, Go::Field implicitField) {
exists(Go::StructType baseType, Go::PromotedField child, int implicitFieldDepth |
baseType = e.(Go::PromotedSelector).getSelectedStructType() and
(

View File

@@ -26,9 +26,9 @@ module IR {
or
this.isAdditional(_, _)
or
this.isAfterTrue(_) and not this.isIn(_)
this.isAfterTrue(_)
or
this.isAfterFalse(_) and not this.isIn(_)
this.isAfterFalse(_)
}
/** Holds if this instruction reads the value of variable or constant `v`. */
@@ -164,9 +164,9 @@ module IR {
/** A condition guard instruction, representing a known boolean outcome for a condition. */
private class ConditionGuardInstruction extends Instruction {
ConditionGuardInstruction() {
this.isAfterTrue(_) and not this.isIn(_)
this.isAfterTrue(_)
or
this.isAfterFalse(_) and not this.isIn(_)
this.isAfterFalse(_)
}
}
@@ -176,7 +176,7 @@ module IR {
class EvalInstruction extends Instruction {
Expr e;
EvalInstruction() { this.isIn(e) and e instanceof Expr }
EvalInstruction() { this.isIn(e) }
/** Gets the expression underlying this instruction. */
Expr getExpr() { result = e }
@@ -778,7 +778,7 @@ module IR {
class DeclareFunctionInstruction extends Instruction {
FuncDecl fd;
DeclareFunctionInstruction() { this.isIn(fd) and fd instanceof FuncDecl }
DeclareFunctionInstruction() { this.isIn(fd) }
override Type getResultType() { result = fd.getType() }
}