Skip to content

Commit a4538de

Browse files
committed
Shared CFG: Rename TNode to TCfgNode
This is in order to avoid name clash with the often so-named IPA type for data- flow nodes. The name clash is not problematic because they are both in scope, but because (cached) IPA types with overlapping names are known to sometimes result in re-evaluation of cached stages, when one of the IPA types gets an internal `#2` suffix in one query run, and the other IPA type gets the suffix in another run.
1 parent de72a76 commit a4538de

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

csharp/ql/lib/semmle/code/csharp/controlflow/ControlFlowGraph.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ module ControlFlow {
2525
* Only nodes that can be reached from the callable entry point are included in
2626
* the CFG.
2727
*/
28-
class Node extends TNode {
28+
class Node extends TCfgNode {
2929
/** Gets a textual representation of this control flow node. */
3030
string toString() { none() }
3131

csharp/ql/lib/semmle/code/csharp/controlflow/internal/ControlFlowGraphImplShared.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,7 @@ private module Cached {
788788
* The control flow graph is pruned for unreachable nodes.
789789
*/
790790
cached
791-
newtype TNode =
791+
newtype TCfgNode =
792792
TEntryNode(CfgScope scope) { succEntrySplits(scope, _, _, _) } or
793793
TAnnotatedExitNode(CfgScope scope, boolean normal) {
794794
exists(Reachability::SameSplitsBlock b, SuccessorType t | b.isReachable(_) |
@@ -807,7 +807,7 @@ private module Cached {
807807

808808
/** Gets a successor node of a given flow type, if any. */
809809
cached
810-
TNode getASuccessor(TNode pred, SuccessorType t) {
810+
TCfgNode getASuccessor(TCfgNode pred, SuccessorType t) {
811811
// Callable entry node -> callable body
812812
exists(ControlFlowElement succElement, Splits succSplits, CfgScope scope |
813813
result = TElementNode(succElement, succSplits) and

ruby/ql/lib/codeql/ruby/controlflow/ControlFlowGraph.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class CfgScope extends Scope instanceof CfgScope::Range_ {
2727
*
2828
* Only nodes that can be reached from an entry point are included in the CFG.
2929
*/
30-
class CfgNode extends TNode {
30+
class CfgNode extends TCfgNode {
3131
/** Gets a textual representation of this control flow node. */
3232
string toString() { none() }
3333

ruby/ql/lib/codeql/ruby/controlflow/internal/ControlFlowGraphImplShared.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,7 @@ private module Cached {
788788
* The control flow graph is pruned for unreachable nodes.
789789
*/
790790
cached
791-
newtype TNode =
791+
newtype TCfgNode =
792792
TEntryNode(CfgScope scope) { succEntrySplits(scope, _, _, _) } or
793793
TAnnotatedExitNode(CfgScope scope, boolean normal) {
794794
exists(Reachability::SameSplitsBlock b, SuccessorType t | b.isReachable(_) |
@@ -807,7 +807,7 @@ private module Cached {
807807

808808
/** Gets a successor node of a given flow type, if any. */
809809
cached
810-
TNode getASuccessor(TNode pred, SuccessorType t) {
810+
TCfgNode getASuccessor(TCfgNode pred, SuccessorType t) {
811811
// Callable entry node -> callable body
812812
exists(ControlFlowElement succElement, Splits succSplits, CfgScope scope |
813813
result = TElementNode(succElement, succSplits) and

0 commit comments

Comments
 (0)