@@ -45,10 +45,12 @@ final class DataFlowCallable extends TDataFlowCallable {
45
45
/**
46
46
* Gets the underlying library callable, if any.
47
47
*/
48
- LibraryCallable asLibraryCallable ( ) { this = TLibraryCallable ( result ) }
48
+ SummarizedCallable asSummarizedCallable ( ) { this = TSummarizedCallable ( result ) }
49
49
50
50
/** Gets a textual representation of this callable. */
51
- string toString ( ) { result = [ this .asCfgScope ( ) .toString ( ) , this .asLibraryCallable ( ) .toString ( ) ] }
51
+ string toString ( ) {
52
+ result = [ this .asCfgScope ( ) .toString ( ) , this .asSummarizedCallable ( ) .toString ( ) ]
53
+ }
52
54
53
55
/** Gets the location of this callable. */
54
56
Location getLocation ( ) { result = this .asCfgScope ( ) .getLocation ( ) }
@@ -65,12 +67,9 @@ final class DataFlowCall extends TDataFlowCall {
65
67
}
66
68
67
69
DataFlowCallable getEnclosingCallable ( ) {
68
- result = TCfgScope ( this .asCallCfgNode ( ) .getExpr ( ) .getEnclosingCfgScope ( ) )
70
+ result . asCfgScope ( ) = this .asCallCfgNode ( ) .getExpr ( ) .getEnclosingCfgScope ( )
69
71
or
70
- exists ( FlowSummaryImpl:: Public:: SummarizedCallable c |
71
- this .isSummaryCall ( c , _) and
72
- result = TLibraryCallable ( c )
73
- )
72
+ this .isSummaryCall ( result .asSummarizedCallable ( ) , _)
74
73
}
75
74
76
75
string toString ( ) {
@@ -401,9 +400,11 @@ module RustDataFlow implements InputSig<Location> {
401
400
402
401
/** Gets a viable implementation of the target of the given `Call`. */
403
402
DataFlowCallable viableCallable ( DataFlowCall call ) {
404
- result .asCfgScope ( ) = call .asCallCfgNode ( ) .getCall ( ) .getStaticTarget ( )
405
- or
406
- result .asLibraryCallable ( ) .getACall ( ) = call .asCallCfgNode ( ) .getCall ( )
403
+ exists ( Callable target | target = call .asCallCfgNode ( ) .getCall ( ) .getStaticTarget ( ) |
404
+ target = result .asCfgScope ( )
405
+ or
406
+ target = result .asSummarizedCallable ( )
407
+ )
407
408
}
408
409
409
410
/**
@@ -757,7 +758,7 @@ module RustDataFlow implements InputSig<Location> {
757
758
predicate allowParameterReturnInSelf ( ParameterNode p ) {
758
759
exists ( DataFlowCallable c , ParameterPosition pos |
759
760
p .isParameterOf ( c , pos ) and
760
- FlowSummaryImpl:: Private:: summaryAllowParameterReturnInSelf ( c .asLibraryCallable ( ) , pos )
761
+ FlowSummaryImpl:: Private:: summaryAllowParameterReturnInSelf ( c .asSummarizedCallable ( ) , pos )
761
762
)
762
763
or
763
764
VariableCapture:: Flow:: heuristicAllowInstanceParameterReturnInSelf ( p .( ClosureParameterNode )
@@ -968,7 +969,7 @@ private module Cached {
968
969
cached
969
970
newtype TDataFlowCallable =
970
971
TCfgScope ( CfgScope scope ) or
971
- TLibraryCallable ( LibraryCallable c )
972
+ TSummarizedCallable ( SummarizedCallable c )
972
973
973
974
/** This is the local flow predicate that is exposed. */
974
975
cached
0 commit comments