@@ -371,7 +371,7 @@ private class PrimaryArgumentNode extends ArgumentNode, OperandNode {
371
371
PrimaryArgumentNode ( ) { exists ( CallInstruction call | op = call .getAnArgumentOperand ( ) ) }
372
372
373
373
override predicate argumentOf ( DataFlowCall call , ArgumentPosition pos ) {
374
- op = call .getArgumentOperand ( pos .( DirectPosition ) .getIndex ( ) )
374
+ op = call .getArgumentOperand ( pos .( DirectPosition ) .getArgumentIndex ( ) )
375
375
}
376
376
}
377
377
@@ -410,8 +410,16 @@ class ParameterPosition = Position;
410
410
class ArgumentPosition = Position ;
411
411
412
412
abstract class Position extends TPosition {
413
+ /** Gets a textual representation of this position. */
413
414
abstract string toString ( ) ;
414
415
416
+ /**
417
+ * Gets the argument index of this position. The qualifier of a call has
418
+ * argument index `-1`.
419
+ */
420
+ abstract int getArgumentIndex ( ) ;
421
+
422
+ /** Gets the indirection index of this position. */
415
423
abstract int getIndirectionIndex ( ) ;
416
424
}
417
425
@@ -428,7 +436,7 @@ class DirectPosition extends Position, TDirectPosition {
428
436
result = index .toString ( )
429
437
}
430
438
431
- int getIndex ( ) { result = index }
439
+ override int getArgumentIndex ( ) { result = index }
432
440
433
441
final override int getIndirectionIndex ( ) { result = 0 }
434
442
}
@@ -445,7 +453,7 @@ class IndirectionPosition extends Position, TIndirectionPosition {
445
453
else result = repeatStars ( indirectionIndex ) + argumentIndex .toString ( )
446
454
}
447
455
448
- int getArgumentIndex ( ) { result = argumentIndex }
456
+ override int getArgumentIndex ( ) { result = argumentIndex }
449
457
450
458
final override int getIndirectionIndex ( ) { result = indirectionIndex }
451
459
}
0 commit comments