@@ -103,10 +103,10 @@ module ArgumentPassing {
103103 * Used to limit the size of predicates.
104104 */
105105 predicate connects ( CallNode call , CallableValue callable ) {
106- exists ( NonLibraryDataFlowSourceCall c , NonLibraryDataFlowCallable k |
106+ exists ( NonLibraryNormalCall c , NonLibraryDataFlowCallable k |
107107 call = c .getNode ( ) and
108108 callable = k .getCallableValue ( ) and
109- k = c .getCallable2 ( )
109+ k = c .getNonLibraryCallable ( )
110110 )
111111 }
112112
@@ -438,7 +438,7 @@ newtype TDataFlowCall =
438438 * Includes function calls, method calls, class calls and library calls.
439439 * All these will be associated with a `CallNode`.
440440 */
441- TNonSpecialCall ( CallNode call ) or
441+ TNormalCall ( CallNode call ) or
442442 /**
443443 * Includes calls to special methods.
444444 * These will be associated with a `SpecialMethodCallNode`.
@@ -449,7 +449,8 @@ newtype TDataFlowCall =
449449 FlowSummaryImpl:: Private:: summaryCallbackRange ( c , receiver )
450450 }
451451
452- class TDataFlowSourceCall = TSpecialCall or TNonSpecialCall ;
452+ /** A call found in the program source (as opposed to a synthesised summary call). */
453+ class TDataFlowSourceCall = TSpecialCall or TNormalCall ;
453454
454455/** A call that is taken into account by the global data flow computation. */
455456abstract class DataFlowCall extends TDataFlowCall {
@@ -500,10 +501,10 @@ abstract class DataFlowSourceCall extends DataFlowCall, TDataFlowSourceCall {
500501}
501502
502503/** A call associated with a `CallNode`. */
503- class NonSpecialCall extends DataFlowSourceCall , TNonSpecialCall {
504+ class NormalCall extends DataFlowSourceCall , TNormalCall {
504505 CallNode call ;
505506
506- NonSpecialCall ( ) { this = TNonSpecialCall ( call ) }
507+ NormalCall ( ) { this = TNormalCall ( call ) }
507508
508509 override string toString ( ) { result = call .toString ( ) }
509510
@@ -516,14 +517,15 @@ class NonSpecialCall extends DataFlowSourceCall, TNonSpecialCall {
516517 override DataFlowCallable getEnclosingCallable ( ) { result .getScope ( ) = call .getNode ( ) .getScope ( ) }
517518}
518519
519- abstract class NonLibraryDataFlowSourceCall extends NonSpecialCall {
520- abstract Node getArg2 ( int n ) ;
520+ /** A (non-special) call that does not go to a library callable. */
521+ abstract class NonLibraryNormalCall extends NormalCall {
522+ abstract Node getNonLibraryArg ( int n ) ;
521523
522- final override Node getArg ( int n ) { result = this .getArg2 ( n ) }
524+ final override Node getArg ( int n ) { result = this .getNonLibraryArg ( n ) }
523525
524- abstract DataFlowCallable getCallable2 ( ) ;
526+ abstract DataFlowCallable getNonLibraryCallable ( ) ;
525527
526- final override DataFlowCallable getCallable ( ) { result = this .getCallable2 ( ) }
528+ final override DataFlowCallable getCallable ( ) { result = this .getNonLibraryCallable ( ) }
527529}
528530
529531/**
@@ -532,51 +534,57 @@ abstract class NonLibraryDataFlowSourceCall extends NonSpecialCall {
532534 * Bound method calls and class calls insert an argument for the explicit
533535 * `self` parameter, and special method calls have special argument passing.
534536 */
535- class FunctionCall extends NonLibraryDataFlowSourceCall {
537+ class FunctionCall extends NonLibraryNormalCall {
536538 NonLibraryDataFlowCallable callable ;
537539
538540 FunctionCall ( ) {
539541 call = any ( FunctionValue f ) .getAFunctionCall ( ) and
540542 call = callable .getACall ( )
541543 }
542544
543- override Node getArg2 ( int n ) { result = getArg ( call , TNoShift ( ) , callable .getCallableValue ( ) , n ) }
545+ override Node getNonLibraryArg ( int n ) {
546+ result = getArg ( call , TNoShift ( ) , callable .getCallableValue ( ) , n )
547+ }
544548
545- override DataFlowCallable getCallable2 ( ) { result = callable }
549+ override DataFlowCallable getNonLibraryCallable ( ) { result = callable }
546550}
547551
548552/** A call to a lambda. */
549- class LambdaCall extends NonLibraryDataFlowSourceCall {
553+ class LambdaCall extends NonLibraryNormalCall {
550554 NonLibraryDataFlowCallable callable ;
551555
552556 LambdaCall ( ) {
553557 call = callable .getACall ( ) and
554558 callable = TLambda ( any ( Function f ) )
555559 }
556560
557- override Node getArg2 ( int n ) { result = getArg ( call , TNoShift ( ) , callable .getCallableValue ( ) , n ) }
561+ override Node getNonLibraryArg ( int n ) {
562+ result = getArg ( call , TNoShift ( ) , callable .getCallableValue ( ) , n )
563+ }
558564
559- override DataFlowCallable getCallable2 ( ) { result = callable }
565+ override DataFlowCallable getNonLibraryCallable ( ) { result = callable }
560566}
561567
562568/**
563569 * Represents a call to a bound method call.
564570 * The node representing the instance is inserted as argument to the `self` parameter.
565571 */
566- class MethodCall extends NonLibraryDataFlowSourceCall {
572+ class MethodCall extends NonLibraryNormalCall {
567573 FunctionValue bm ;
568574
569575 MethodCall ( ) { call = bm .getAMethodCall ( ) }
570576
571577 private CallableValue getCallableValue ( ) { result = bm }
572578
573- override Node getArg2 ( int n ) {
579+ override Node getNonLibraryArg ( int n ) {
574580 n > 0 and result = getArg ( call , TShiftOneUp ( ) , this .getCallableValue ( ) , n )
575581 or
576582 n = 0 and result = TCfgNode ( call .getFunction ( ) .( AttrNode ) .getObject ( ) )
577583 }
578584
579- override DataFlowCallable getCallable2 ( ) { result = TCallableValue ( this .getCallableValue ( ) ) }
585+ override DataFlowCallable getNonLibraryCallable ( ) {
586+ result = TCallableValue ( this .getCallableValue ( ) )
587+ }
580588}
581589
582590/**
@@ -585,7 +593,7 @@ class MethodCall extends NonLibraryDataFlowSourceCall {
585593 * That makes the call node be the post-update node holding the value of the object
586594 * after the constructor has run.
587595 */
588- class ClassCall extends NonLibraryDataFlowSourceCall {
596+ class ClassCall extends NonLibraryNormalCall {
589597 ClassValue c ;
590598
591599 ClassCall ( ) {
@@ -595,13 +603,15 @@ class ClassCall extends NonLibraryDataFlowSourceCall {
595603
596604 private CallableValue getCallableValue ( ) { c .getScope ( ) .getInitMethod ( ) = result .getScope ( ) }
597605
598- override Node getArg2 ( int n ) {
606+ override Node getNonLibraryArg ( int n ) {
599607 n > 0 and result = getArg ( call , TShiftOneUp ( ) , this .getCallableValue ( ) , n )
600608 or
601609 n = 0 and result = TSyntheticPreUpdateNode ( TCfgNode ( call ) )
602610 }
603611
604- override DataFlowCallable getCallable2 ( ) { result = TCallableValue ( this .getCallableValue ( ) ) }
612+ override DataFlowCallable getNonLibraryCallable ( ) {
613+ result = TCallableValue ( this .getCallableValue ( ) )
614+ }
605615}
606616
607617/** A call to a special method. */
@@ -626,7 +636,7 @@ class SpecialCall extends DataFlowSourceCall, TSpecialCall {
626636}
627637
628638/** A call to a summarized callable. */
629- class LibraryCall extends NonSpecialCall {
639+ class LibraryCall extends NormalCall {
630640 LibraryCallable callable ;
631641
632642 LibraryCall ( ) { call .getNode ( ) = callable .getACall ( ) }
0 commit comments