From 5dc910d0dbd05c6f7b50cb7ae0fef19f0584cc6a Mon Sep 17 00:00:00 2001 From: Nick Rolfe Date: Fri, 30 Apr 2021 15:05:12 +0100 Subject: [PATCH] Move `track` predicate to LocalSourceNode --- .../dataflow/internal/DataFlowPublic.qll | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/ql/src/codeql_ruby/dataflow/internal/DataFlowPublic.qll b/ql/src/codeql_ruby/dataflow/internal/DataFlowPublic.qll index 0d957f7dd35..775d0bde444 100644 --- a/ql/src/codeql_ruby/dataflow/internal/DataFlowPublic.qll +++ b/ql/src/codeql_ruby/dataflow/internal/DataFlowPublic.qll @@ -37,14 +37,6 @@ class Node extends TNode { ) { getLocation().hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn) } - - /** - * Gets a node that this node may flow to using one heap and/or interprocedural step. - * - * See `TypeTracker` for more details about how to use this. - */ - pragma[inline] - LocalSourceNode track(TypeTracker t2, TypeTracker t) { t = t2.step(this, result) } } /** @@ -91,6 +83,14 @@ class LocalSourceNode extends Node { /** Holds if this `LocalSourceNode` can flow to `nodeTo` in one or more local flow steps. */ pragma[inline] predicate flowsTo(Node nodeTo) { hasLocalSource(nodeTo, this) } + + /** + * Gets a node that this node may flow to using one heap and/or interprocedural step. + * + * See `TypeTracker` for more details about how to use this. + */ + pragma[inline] + LocalSourceNode track(TypeTracker t2, TypeTracker t) { t = t2.step(this, result) } } predicate hasLocalSource(Node sink, Node source) {