| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -998,20 +998,34 @@ private class InstanceCallable extends Callable { | |||
| 998 | 998 | /** | |
| 999 | 999 | * A callable which is either itself defined in source or which is the target | |
| 1000 | 1000 | * of some call in source, and therefore ought to have dataflow nodes created. | |
| 1001 | + * | ||
| 1002 | + * Note that for library methods these are always unbound declarations, since | ||
| 1003 | + * generic instantiations never have dataflow nodes constructed. | ||
| 1001 | 1004 | */ | |
| 1002 | 1005 | private class CallableUsedInSource extends Callable { | |
| 1003 | 1006 | CallableUsedInSource() { | |
| 1007 | + // Should generate nodes even for abstract methods declared in source | ||
| 1004 | 1008 | this.fromSource() | |
| 1005 | 1009 | or | |
| 1006 | - // Note that getARuntimeTarget cannot be used here, because the | ||
| 1007 | - // DelegateLikeCall case depends on lambda-flow, which in turn | ||
| 1008 | - // uses the dataflow library; hence this would introduce recursion | ||
| 1009 | - // into the definition of data-flow nodes. | ||
| 1010 | - exists(Call c, DispatchCall dc | c.fromSource() and c = dc.getCall() | | ||
| 1011 | - this = dc.getADynamicTarget() | ||
| 1012 | - ) | ||
| 1010 | + // Should generate nodes even for synthetic methods derived from source | ||
| 1011 | + this.hasBody() | ||
| 1013 | 1012 | or | |
| 1014 | - this = any(CallableAccess ca | ca.fromSource()).getTarget() | ||
| 1013 | + exists(Callable target | | ||
| 1014 | + exists(Call c | c.fromSource() | | ||
| 1015 | + // Note that getADynamicTarget does not always include getTarget. | ||
| 1016 | + target = c.getTarget() | ||
| 1017 | + or | ||
| 1018 | + // Note that getARuntimeTarget cannot be used here, because the | ||
| 1019 | + // DelegateLikeCall case depends on lambda-flow, which in turn | ||
| 1020 | + // uses the dataflow library; hence this would introduce recursion | ||
| 1021 | + // into the definition of data-flow nodes. | ||
| 1022 | + exists(DispatchCall dc | c = dc.getCall() | target = dc.getADynamicTarget()) | ||
| 1023 | + ) | ||
| 1024 | + or | ||
| 1025 | + target = any(CallableAccess ca | ca.fromSource()).getTarget() | ||
| 1026 | + | | ||
| 1027 | + this = target.getUnboundDeclaration() | ||
| 1028 | + ) | ||
| 1015 | 1029 | } | |
| 1016 | 1030 | } | |
| 1017 | 1031 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments