mirror of
https://github.com/github/codeql.git
synced 2026-04-28 10:15:14 +02:00
Ruby: Ensure Node::{toString,getLocation} are computed in data flow stage
This commit is contained in:
@@ -340,6 +340,12 @@ private module Cached {
|
||||
p.(KeywordParameter).getDefaultValue() = e.getExprNode().getExpr()
|
||||
}
|
||||
|
||||
cached
|
||||
Location getLocation(NodeImpl n) { result = n.getLocationImpl() }
|
||||
|
||||
cached
|
||||
string toString(NodeImpl n) { result = n.toStringImpl() }
|
||||
|
||||
/**
|
||||
* This is the local flow predicate that is used as a building block in global
|
||||
* data flow.
|
||||
|
||||
@@ -19,12 +19,10 @@ class Node extends TNode {
|
||||
Parameter asParameter() { result = this.(ParameterNode).getParameter() }
|
||||
|
||||
/** Gets a textual representation of this node. */
|
||||
cached
|
||||
final string toString() { result = this.(NodeImpl).toStringImpl() }
|
||||
final string toString() { result = toString(this) }
|
||||
|
||||
/** Gets the location of this node. */
|
||||
cached
|
||||
final Location getLocation() { result = this.(NodeImpl).getLocationImpl() }
|
||||
final Location getLocation() { result = getLocation(this) }
|
||||
|
||||
/**
|
||||
* Holds if this element is at the specified location.
|
||||
|
||||
Reference in New Issue
Block a user