CodeQL library for Go
codeql/go-all 2.1.3 (changelog, source)
Search

Class IR::ElementReadInstruction

An IR instruction that reads an element of an array, slice, map or string.

Import path

import semmle.go.controlflow.IR

Direct supertypes

Indirect supertypes

Fields

Predicates

getIndex

Gets the instruction computing the index of the element being looked up.

readsElement

Holds if this instruction reads the value of element index on the value of base.

Inherited predicates

dominatesNode

Holds if this node dominates dominee in the control-flow graph.

from Node
getAPredecessor

Gets a node that directly precedes this one in the control-flow graph.

from Node
getASuccessor

Gets a node that directly follows this one in the control-flow graph.

from Node
getBase

Gets the instruction computing the base value on which the field or element is read.

from ComponentReadInstruction
getBasicBlock

Gets the basic block to which this node belongs.

from Node
getBoolValue

Gets the Boolean value of the result of this instruction, if it can be determined.

from EvalInstruction
getExactValue

Gets the string representation of the exact value of the result of this instruction, if any.

from EvalInstruction
getExpr

Gets the expression underlying this instruction.

from EvalInstruction
getFile

Gets the file to which this node belongs.

from Node
getFloatValue

Gets the float value of the result of this instruction, if it can be determined.

from EvalInstruction
getInsnKind

Gets a textual representation of the kind of this instruction.

from Instruction
getIntValue

Gets the int value of the result of this instruction, if it can be determined.

from EvalInstruction
getNumericValue

Gets either getFloatValue or getIntValue

from Instruction
getResultType

Gets the type of the result of this instruction, if any.

from EvalInstruction
getRoot

Gets the innermost function or file to which this node belongs.

from EvalInstruction
getStringValue

Gets the string value of the result of this instruction, if it can be determined.

from EvalInstruction
hasComplexValue

Holds if the complex value of the result of this instruction has real part real and imaginary part imag.

from EvalInstruction
hasLocationInfo

Holds if this element is at the specified location. The location spans column startcolumn of line startline to column endcolumn of line endline in file filepath. For more information, see Locations.

from EvalInstruction
isBranch

Holds if this is a node with more than one successor.

from Node
isConst

Holds if the result of this instruction is known at compile time.

from EvalInstruction
isEntryNode

Holds if this node is the (unique) entry node of a function or file.

from Node
isExitNode

Holds if this node is the (unique) exit node of a function or file.

from Node
isFirstNodeOf

Holds if this is the first control-flow node in subtree.

from Node
isJoin

Holds if this is a node with more than one predecessor.

from Node
isPlatformIndependentConstant

Holds if the result of this instruction is known at compile time, and is guaranteed not to depend on the platform where it is evaluated.

from EvalInstruction
reads

Holds if this instruction reads the value of variable or constant v.

from EvalInstruction
readsField

Holds if this instruction reads the value of field f on the value of base.

from Instruction
readsMethod

Holds if this instruction looks up method m on the value of receiver.

from Instruction
toString

Gets a textual representation of this control flow node.

from EvalInstruction
writes

Holds if this instruction updates variable or constant v to the value of rhs.

from Instruction
writesElement

Holds if this instruction updates the value of element index on the value of base.

from Instruction
writesField

Holds if this instruction updates the value of field f on the value of base.

from Instruction