@@ -593,30 +593,29 @@ class ReadNode extends InstructionNode {
593593/**
594594 * A data-flow node that reads the value of a field from a struct, or an element from an array, slice, map or string.
595595 */
596- abstract class ReadFromAggregateNode extends ReadNode {
596+ class ComponentReadNode extends ReadNode {
597+ override IR:: ComponentReadInstruction insn ;
598+
597599 /** Gets the data-flow node representing the base from which the field or element is read. */
598- abstract Node getBase ( ) ;
600+ Node getBase ( ) { result = instructionNode ( insn . getBase ( ) ) }
599601}
600602
601603/**
602- * Gets the data-flow node representing the bottom of a stack of zero or more `ReadFromAggregateNode `s.
604+ * Gets the data-flow node representing the bottom of a stack of zero or more `ComponentReadNode `s.
603605 *
604606 * For example, in the expression a.b[c].d[e], this would return the dataflow node for the read from `a`.
605607 */
606608Node getUnderlyingNode ( ReadNode read ) {
607- ( result = read or result = read .( ReadFromAggregateNode ) .getBase + ( ) ) and
608- not result instanceof ReadFromAggregateNode
609+ ( result = read or result = read .( ComponentReadNode ) .getBase + ( ) ) and
610+ not result instanceof ComponentReadNode
609611}
610612
611613/**
612614 * A data-flow node that reads an element of an array, map, slice or string.
613615 */
614- class ElementReadNode extends ReadFromAggregateNode {
616+ class ElementReadNode extends ComponentReadNode {
615617 override IR:: ElementReadInstruction insn ;
616618
617- /** Gets the data-flow node representing the base from which the element is read. */
618- override Node getBase ( ) { result = instructionNode ( insn .getBase ( ) ) }
619-
620619 /** Gets the data-flow node representing the index of the element being read. */
621620 Node getIndex ( ) { result = instructionNode ( insn .getIndex ( ) ) }
622621
@@ -762,12 +761,9 @@ class AddressOperationNode extends UnaryOperationNode, ExprNode {
762761/**
763762 * A data-flow node that reads the value of a field.
764763 */
765- class FieldReadNode extends ReadFromAggregateNode {
764+ class FieldReadNode extends ComponentReadNode {
766765 override IR:: FieldReadInstruction insn ;
767766
768- /** Gets the base node from which the field is read. */
769- override Node getBase ( ) { result = instructionNode ( insn .getBase ( ) ) }
770-
771767 /** Gets the field this node reads. */
772768 Field getField ( ) { result = insn .getField ( ) }
773769
0 commit comments