@@ -43,10 +43,12 @@ final class DataFlowCallable extends TDataFlowCallable {
4343 /**
4444 * Gets the underlying library callable, if any.
4545 */
46- LibraryCallable asLibraryCallable ( ) { this = TLibraryCallable ( result ) }
46+ SummarizedCallable asSummarizedCallable ( ) { this = TSummarizedCallable ( result ) }
4747
4848 /** Gets a textual representation of this callable. */
49- string toString ( ) { result = [ this .asCfgScope ( ) .toString ( ) , this .asLibraryCallable ( ) .toString ( ) ] }
49+ string toString ( ) {
50+ result = [ this .asCfgScope ( ) .toString ( ) , this .asSummarizedCallable ( ) .toString ( ) ]
51+ }
5052
5153 /** Gets the location of this callable. */
5254 Location getLocation ( ) { result = this .asCfgScope ( ) .getLocation ( ) }
@@ -67,12 +69,9 @@ final class DataFlowCall extends TDataFlowCall {
6769 }
6870
6971 DataFlowCallable getEnclosingCallable ( ) {
70- result = TCfgScope ( this .asCallBaseExprCfgNode ( ) .getExpr ( ) .getEnclosingCfgScope ( ) )
72+ result . asCfgScope ( ) = this .asCallBaseExprCfgNode ( ) .getExpr ( ) .getEnclosingCfgScope ( )
7173 or
72- exists ( FlowSummaryImpl:: Public:: SummarizedCallable c |
73- this .isSummaryCall ( c , _) and
74- result = TLibraryCallable ( c )
75- )
74+ this .isSummaryCall ( result .asSummarizedCallable ( ) , _)
7675 }
7776
7877 string toString ( ) {
@@ -434,9 +433,13 @@ module RustDataFlow implements InputSig<Location> {
434433
435434 /** Gets a viable implementation of the target of the given `Call`. */
436435 DataFlowCallable viableCallable ( DataFlowCall call ) {
437- result .asCfgScope ( ) = call .asCallBaseExprCfgNode ( ) .getCallExprBase ( ) .getStaticTarget ( )
438- or
439- result .asLibraryCallable ( ) .getACall ( ) = call .asCallBaseExprCfgNode ( ) .getCallExprBase ( )
436+ exists ( Callable target |
437+ target = call .asCallBaseExprCfgNode ( ) .getCallExprBase ( ) .getStaticTarget ( )
438+ |
439+ target = result .asCfgScope ( )
440+ or
441+ target = result .asSummarizedCallable ( )
442+ )
440443 }
441444
442445 /**
@@ -784,7 +787,7 @@ module RustDataFlow implements InputSig<Location> {
784787 predicate allowParameterReturnInSelf ( ParameterNode p ) {
785788 exists ( DataFlowCallable c , ParameterPosition pos |
786789 p .isParameterOf ( c , pos ) and
787- FlowSummaryImpl:: Private:: summaryAllowParameterReturnInSelf ( c .asLibraryCallable ( ) , pos )
790+ FlowSummaryImpl:: Private:: summaryAllowParameterReturnInSelf ( c .asSummarizedCallable ( ) , pos )
788791 )
789792 or
790793 VariableCapture:: Flow:: heuristicAllowInstanceParameterReturnInSelf ( p .( ClosureParameterNode )
@@ -995,7 +998,7 @@ private module Cached {
995998 cached
996999 newtype TDataFlowCallable =
9971000 TCfgScope ( CfgScope scope ) or
998- TLibraryCallable ( LibraryCallable c )
1001+ TSummarizedCallable ( SummarizedCallable c )
9991002
10001003 /** This is the local flow predicate that is exposed. */
10011004 cached
0 commit comments