@@ -44,10 +44,12 @@ final class DataFlowCallable extends TDataFlowCallable {
4444 /**
4545 * Gets the underlying library callable, if any.
4646 */
47- LibraryCallable asLibraryCallable ( ) { this = TLibraryCallable ( result ) }
47+ SummarizedCallable asSummarizedCallable ( ) { this = TSummarizedCallable ( result ) }
4848
4949 /** Gets a textual representation of this callable. */
50- string toString ( ) { result = [ this .asCfgScope ( ) .toString ( ) , this .asLibraryCallable ( ) .toString ( ) ] }
50+ string toString ( ) {
51+ result = [ this .asCfgScope ( ) .toString ( ) , this .asSummarizedCallable ( ) .toString ( ) ]
52+ }
5153
5254 /** Gets the location of this callable. */
5355 Location getLocation ( ) { result = this .asCfgScope ( ) .getLocation ( ) }
@@ -68,12 +70,9 @@ final class DataFlowCall extends TDataFlowCall {
6870 }
6971
7072 DataFlowCallable getEnclosingCallable ( ) {
71- result = TCfgScope ( this .asCallBaseExprCfgNode ( ) .getExpr ( ) .getEnclosingCfgScope ( ) )
73+ result . asCfgScope ( ) = this .asCallBaseExprCfgNode ( ) .getExpr ( ) .getEnclosingCfgScope ( )
7274 or
73- exists ( FlowSummaryImpl:: Public:: SummarizedCallable c |
74- this .isSummaryCall ( c , _) and
75- result = TLibraryCallable ( c )
76- )
75+ this .isSummaryCall ( result .asSummarizedCallable ( ) , _)
7776 }
7877
7978 string toString ( ) {
@@ -419,9 +418,13 @@ module RustDataFlow implements InputSig<Location> {
419418
420419 /** Gets a viable implementation of the target of the given `Call`. */
421420 DataFlowCallable viableCallable ( DataFlowCall call ) {
422- result .asCfgScope ( ) = call .asCallBaseExprCfgNode ( ) .getCallExprBase ( ) .getStaticTarget ( )
423- or
424- result .asLibraryCallable ( ) .getACall ( ) = call .asCallBaseExprCfgNode ( ) .getCallExprBase ( )
421+ exists ( Callable target |
422+ target = call .asCallBaseExprCfgNode ( ) .getCallExprBase ( ) .getStaticTarget ( )
423+ |
424+ target = result .asCfgScope ( )
425+ or
426+ target = result .asSummarizedCallable ( )
427+ )
425428 }
426429
427430 /**
@@ -775,7 +778,7 @@ module RustDataFlow implements InputSig<Location> {
775778 predicate allowParameterReturnInSelf ( ParameterNode p ) {
776779 exists ( DataFlowCallable c , ParameterPosition pos |
777780 p .isParameterOf ( c , pos ) and
778- FlowSummaryImpl:: Private:: summaryAllowParameterReturnInSelf ( c .asLibraryCallable ( ) , pos )
781+ FlowSummaryImpl:: Private:: summaryAllowParameterReturnInSelf ( c .asSummarizedCallable ( ) , pos )
779782 )
780783 or
781784 VariableCapture:: Flow:: heuristicAllowInstanceParameterReturnInSelf ( p .( ClosureParameterNode )
@@ -986,7 +989,7 @@ private module Cached {
986989 cached
987990 newtype TDataFlowCallable =
988991 TCfgScope ( CfgScope scope ) or
989- TLibraryCallable ( LibraryCallable c )
992+ TSummarizedCallable ( SummarizedCallable c )
990993
991994 /** This is the local flow predicate that is exposed. */
992995 cached
0 commit comments