@@ -593,30 +593,29 @@ class ReadNode extends InstructionNode {
593
593
/**
594
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
595
*/
596
- abstract class ReadFromAggregateNode extends ReadNode {
596
+ class ComponentReadNode extends ReadNode {
597
+ override IR:: ComponentReadInstruction insn ;
598
+
597
599
/** 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 ( ) ) }
599
601
}
600
602
601
603
/**
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.
603
605
*
604
606
* For example, in the expression a.b[c].d[e], this would return the dataflow node for the read from `a`.
605
607
*/
606
608
Node 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
609
611
}
610
612
611
613
/**
612
614
* A data-flow node that reads an element of an array, map, slice or string.
613
615
*/
614
- class ElementReadNode extends ReadFromAggregateNode {
616
+ class ElementReadNode extends ComponentReadNode {
615
617
override IR:: ElementReadInstruction insn ;
616
618
617
- /** Gets the data-flow node representing the base from which the element is read. */
618
- override Node getBase ( ) { result = instructionNode ( insn .getBase ( ) ) }
619
-
620
619
/** Gets the data-flow node representing the index of the element being read. */
621
620
Node getIndex ( ) { result = instructionNode ( insn .getIndex ( ) ) }
622
621
@@ -762,12 +761,9 @@ class AddressOperationNode extends UnaryOperationNode, ExprNode {
762
761
/**
763
762
* A data-flow node that reads the value of a field.
764
763
*/
765
- class FieldReadNode extends ReadFromAggregateNode {
764
+ class FieldReadNode extends ComponentReadNode {
766
765
override IR:: FieldReadInstruction insn ;
767
766
768
- /** Gets the base node from which the field is read. */
769
- override Node getBase ( ) { result = instructionNode ( insn .getBase ( ) ) }
770
-
771
767
/** Gets the field this node reads. */
772
768
Field getField ( ) { result = insn .getField ( ) }
773
769
0 commit comments