From 37c8d8a2523eb66b0a9d44fcd6c086ffac23e609 Mon Sep 17 00:00:00 2001 From: Nick Rolfe Date: Fri, 30 Apr 2021 14:41:50 +0100 Subject: [PATCH] Rename getCallable to getTarget --- ql/src/codeql_ruby/dataflow/internal/DataFlowDispatch.qll | 2 +- ql/src/codeql_ruby/typetracking/TypeTrackerSpecific.qll | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ql/src/codeql_ruby/dataflow/internal/DataFlowDispatch.qll b/ql/src/codeql_ruby/dataflow/internal/DataFlowDispatch.qll index a539e18b069..916ea836e63 100644 --- a/ql/src/codeql_ruby/dataflow/internal/DataFlowDispatch.qll +++ b/ql/src/codeql_ruby/dataflow/internal/DataFlowDispatch.qll @@ -41,7 +41,7 @@ class DataFlowCallable = CfgScope; class DataFlowCall extends CfgNodes::ExprNodes::CallCfgNode { DataFlowCallable getEnclosingCallable() { result = this.getScope() } - DataFlowCallable getCallable() { + DataFlowCallable getTarget() { // TODO: this is a placeholder that finds a method with the same name, iff it's uniquely named. result = unique(DataFlowCallable c | c.(Method).getName() = this.getNode().(MethodCall).getMethodName()) diff --git a/ql/src/codeql_ruby/typetracking/TypeTrackerSpecific.qll b/ql/src/codeql_ruby/typetracking/TypeTrackerSpecific.qll index 2361fcaeaf4..b7a512ec8ee 100644 --- a/ql/src/codeql_ruby/typetracking/TypeTrackerSpecific.qll +++ b/ql/src/codeql_ruby/typetracking/TypeTrackerSpecific.qll @@ -24,7 +24,7 @@ predicate callStep( DataFlowPrivate::ArgumentNode nodeFrom, DataFlowPrivate::ExplicitParameterNode nodeTo ) { exists(DataFlowDispatch::DataFlowCall call, DataFlowDispatch::DataFlowCallable callable, int i | - call.getCallable() = callable and + call.getTarget() = callable and nodeFrom.argumentOf(call, i) and nodeTo.isParameterOf(callable, i) ) @@ -33,7 +33,7 @@ predicate callStep( /** Holds if `nodeFrom` steps to `nodeTo` by being returned from a call. */ predicate returnStep(DataFlowPrivate::ReturnNode nodeFrom, Node nodeTo) { exists(DataFlowDispatch::DataFlowCall call | - nodeFrom.getEnclosingCallable() = call.getCallable() and + nodeFrom.getEnclosingCallable() = call.getTarget() and nodeTo.asExpr().getNode() = call.getNode() ) }