@@ -43,10 +43,12 @@ final class DataFlowCallable extends TDataFlowCallable {
43
43
/**
44
44
* Gets the underlying library callable, if any.
45
45
*/
46
- LibraryCallable asLibraryCallable ( ) { this = TLibraryCallable ( result ) }
46
+ SummarizedCallable asSummarizedCallable ( ) { this = TSummarizedCallable ( result ) }
47
47
48
48
/** 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
+ }
50
52
51
53
/** Gets the location of this callable. */
52
54
Location getLocation ( ) { result = this .asCfgScope ( ) .getLocation ( ) }
@@ -67,12 +69,9 @@ final class DataFlowCall extends TDataFlowCall {
67
69
}
68
70
69
71
DataFlowCallable getEnclosingCallable ( ) {
70
- result = TCfgScope ( this .asCallBaseExprCfgNode ( ) .getExpr ( ) .getEnclosingCfgScope ( ) )
72
+ result . asCfgScope ( ) = this .asCallBaseExprCfgNode ( ) .getExpr ( ) .getEnclosingCfgScope ( )
71
73
or
72
- exists ( FlowSummaryImpl:: Public:: SummarizedCallable c |
73
- this .isSummaryCall ( c , _) and
74
- result = TLibraryCallable ( c )
75
- )
74
+ this .isSummaryCall ( result .asSummarizedCallable ( ) , _)
76
75
}
77
76
78
77
string toString ( ) {
@@ -434,9 +433,13 @@ module RustDataFlow implements InputSig<Location> {
434
433
435
434
/** Gets a viable implementation of the target of the given `Call`. */
436
435
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
+ )
440
443
}
441
444
442
445
/**
@@ -784,7 +787,7 @@ module RustDataFlow implements InputSig<Location> {
784
787
predicate allowParameterReturnInSelf ( ParameterNode p ) {
785
788
exists ( DataFlowCallable c , ParameterPosition pos |
786
789
p .isParameterOf ( c , pos ) and
787
- FlowSummaryImpl:: Private:: summaryAllowParameterReturnInSelf ( c .asLibraryCallable ( ) , pos )
790
+ FlowSummaryImpl:: Private:: summaryAllowParameterReturnInSelf ( c .asSummarizedCallable ( ) , pos )
788
791
)
789
792
or
790
793
VariableCapture:: Flow:: heuristicAllowInstanceParameterReturnInSelf ( p .( ClosureParameterNode )
@@ -995,7 +998,7 @@ private module Cached {
995
998
cached
996
999
newtype TDataFlowCallable =
997
1000
TCfgScope ( CfgScope scope ) or
998
- TLibraryCallable ( LibraryCallable c )
1001
+ TSummarizedCallable ( SummarizedCallable c )
999
1002
1000
1003
/** This is the local flow predicate that is exposed. */
1001
1004
cached
0 commit comments