mirror of
https://github.com/github/codeql.git
synced 2026-05-01 19:55:15 +02:00
Python: change type of LibraryCallable::getACall
The other callables return control flow nodes, so it is slightly inconsistent for this to return a data flow node, but it does make models based on API graphs nicer.
This commit is contained in:
@@ -84,10 +84,10 @@ private class SummarizedCallableFromModel extends SummarizedCallable {
|
||||
this = package + ";" + type + ";" + path
|
||||
}
|
||||
|
||||
override CallNode getACall() {
|
||||
override CallCfgNode getACall() {
|
||||
exists(API::CallNode base |
|
||||
ModelOutput::resolvedSummaryBase(package, type, path, base) and
|
||||
result = base.asCfgNode()
|
||||
result = base.getACall()
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -281,7 +281,7 @@ abstract class LibraryCallable extends string {
|
||||
LibraryCallable() { any() }
|
||||
|
||||
/** Gets a call to this library callable. */
|
||||
abstract CallNode getACall();
|
||||
abstract CallCfgNode getACall();
|
||||
|
||||
/** Gets a data-flow node, where this library callable is used as a call-back. */
|
||||
abstract ArgumentNode getACallback();
|
||||
@@ -398,7 +398,7 @@ class LibraryCallableValue extends DataFlowCallable, TLibraryCallable {
|
||||
|
||||
override string toString() { result = callable.toString() }
|
||||
|
||||
override CallNode getACall() { result = callable.getACall() }
|
||||
override CallNode getACall() { result = callable.getACall().getNode() }
|
||||
|
||||
/** Gets a data-flow node, where this library callable is used as a call-back. */
|
||||
ArgumentNode getACallback() { result = callable.getACallback() }
|
||||
@@ -772,7 +772,7 @@ DataFlowCallable viableCallable(DataFlowSourceCall call) {
|
||||
// Instead we reolve the call from the summary.
|
||||
exists(LibraryCallable callable |
|
||||
result = TLibraryCallable(callable) and
|
||||
call.getNode() = callable.getACall()
|
||||
call.getNode() = callable.getACall().getNode()
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ private import semmle.python.ApiGraphs
|
||||
class ReversedSummary extends SummarizedCallable {
|
||||
ReversedSummary() { this = "builtins.reversed" }
|
||||
|
||||
override CallNode getACall() { result = API::builtin("reversed").getACall().getNode() }
|
||||
override DataFlow::CallCfgNode getACall() { result = API::builtin("reversed").getACall() }
|
||||
|
||||
override DataFlow::ArgumentNode getACallback() {
|
||||
result = API::builtin("reversed").getAValueReachableFromSource()
|
||||
|
||||
Reference in New Issue
Block a user