@@ -590,14 +590,22 @@ class ReadNode extends InstructionNode {
590590 }
591591}
592592
593+ /**
594+ * A data-flow node that reads the value of a field from a struct, or an element from an array, slice, map or string.
595+ */
596+ class ReadFromAggregateNode extends ReadNode {
597+ /** Gets the data-flow node representing the base from which the field or element is read. */
598+ abstract Node getBase ( ) ;
599+ }
600+
593601/**
594602 * A data-flow node that reads an element of an array, map, slice or string.
595603 */
596- class ElementReadNode extends ReadNode {
604+ class ElementReadNode extends ReadFromAggregateNode {
597605 override IR:: ElementReadInstruction insn ;
598606
599607 /** Gets the data-flow node representing the base from which the element is read. */
600- Node getBase ( ) { result = instructionNode ( insn .getBase ( ) ) }
608+ override Node getBase ( ) { result = instructionNode ( insn .getBase ( ) ) }
601609
602610 /** Gets the data-flow node representing the index of the element being read. */
603611 Node getIndex ( ) { result = instructionNode ( insn .getIndex ( ) ) }
@@ -744,11 +752,11 @@ class AddressOperationNode extends UnaryOperationNode, ExprNode {
744752/**
745753 * A data-flow node that reads the value of a field.
746754 */
747- class FieldReadNode extends ReadNode {
755+ class FieldReadNode extends ReadFromAggregateNode {
748756 override IR:: FieldReadInstruction insn ;
749757
750758 /** Gets the base node from which the field is read. */
751- Node getBase ( ) { result = instructionNode ( insn .getBase ( ) ) }
759+ override Node getBase ( ) { result = instructionNode ( insn .getBase ( ) ) }
752760
753761 /** Gets the field this node reads. */
754762 Field getField ( ) { result = insn .getField ( ) }
0 commit comments