mirror of
https://github.com/github/codeql.git
synced 2026-05-14 11:19:27 +02:00
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:
committed by
Owen Mansel-Chan
parent
8bd2effeff
commit
ef6e973831
@@ -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
|
||||
(
|
||||
|
||||
@@ -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() }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user