mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +01:00
Python: Cache a few call-graph predicates
We DON'T want to recompute these ones for sure!
This commit is contained in:
@@ -1039,6 +1039,7 @@ predicate resolveClassInstanceCall(CallNode call, Function target, Node self) {
|
|||||||
/**
|
/**
|
||||||
* Holds if `call` is a call to the `target`, with call-type `type`.
|
* Holds if `call` is a call to the `target`, with call-type `type`.
|
||||||
*/
|
*/
|
||||||
|
cached
|
||||||
predicate resolveCall(ControlFlowNode call, Function target, CallType type) {
|
predicate resolveCall(ControlFlowNode call, Function target, CallType type) {
|
||||||
type instanceof CallTypePlainFunction and
|
type instanceof CallTypePlainFunction and
|
||||||
call.(CallNode).getFunction() = functionTracker(target).asCfgNode() and
|
call.(CallNode).getFunction() = functionTracker(target).asCfgNode() and
|
||||||
@@ -1114,6 +1115,7 @@ predicate normalCallArg(CallNode call, Node arg, ArgumentPosition apos) {
|
|||||||
* Note: If `Bar.meth` and `Foo.meth` resolves to the same function, we will end up
|
* Note: If `Bar.meth` and `Foo.meth` resolves to the same function, we will end up
|
||||||
* sending both `self` arguments to that function, which is by definition the right thing to do.
|
* sending both `self` arguments to that function, which is by definition the right thing to do.
|
||||||
*/
|
*/
|
||||||
|
cached
|
||||||
predicate getCallArg(
|
predicate getCallArg(
|
||||||
ControlFlowNode call, Function target, CallType type, Node arg, ArgumentPosition apos
|
ControlFlowNode call, Function target, CallType type, Node arg, ArgumentPosition apos
|
||||||
) {
|
) {
|
||||||
|
|||||||
Reference in New Issue
Block a user