mirror of
https://github.com/github/codeql.git
synced 2025-12-21 03:06:31 +01:00
Python: do not stake out too much territory
This commit is contained in:
@@ -617,6 +617,18 @@ class SpecialCall extends DataFlowSourceCall, TSpecialCall {
|
|||||||
* and not be available for a summary.
|
* and not be available for a summary.
|
||||||
*/
|
*/
|
||||||
class LibraryCall extends NormalCall {
|
class LibraryCall extends NormalCall {
|
||||||
|
LibraryCall() {
|
||||||
|
// TODO: share this with `resolvedCall`
|
||||||
|
not (
|
||||||
|
call = any(DataFlowCallableValue cv).getACall()
|
||||||
|
or
|
||||||
|
call = any(DataFlowLambda l).getACall()
|
||||||
|
or
|
||||||
|
// TODO: this should be covered by `DataFlowCallableValue`, but a `ClassValue` is not a `CallableValue`.
|
||||||
|
call = any(ClassValue c).getACall()
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: Implement Python calling convention?
|
// TODO: Implement Python calling convention?
|
||||||
override Node getArg(int n) { result = TCfgNode(call.getArg(n)) }
|
override Node getArg(int n) { result = TCfgNode(call.getArg(n)) }
|
||||||
|
|
||||||
|
|||||||
@@ -32,6 +32,6 @@ try:
|
|||||||
# ignored.
|
# ignored.
|
||||||
import mypkg
|
import mypkg
|
||||||
mypkg.foo(42) # $ call=mypkg.foo(..) qlclass=NormalCall
|
mypkg.foo(42) # $ call=mypkg.foo(..) qlclass=NormalCall
|
||||||
mypkg.subpkg.bar(43) # $ call=mypkg.subpkg.bar(..) qlclass=NormalCall
|
mypkg.subpkg.bar(43) # $ call=mypkg.subpkg.bar(..) qlclass=LibraryCall arg_0=43
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|||||||
Reference in New Issue
Block a user