Cfg

io.joern.x2cpg.passes.controlflow.cfgcreation.Cfg
See theCfg companion object
case class Cfg(entryNode: Option[CfgNode], edges: List[CfgEdge], fringe: List[(CfgNode, CfgEdgeType)], labeledNodes: Map[String, CfgNode], breaks: List[(CfgNode, Int)], continues: List[(CfgNode, Int)], caseLabels: List[CfgNode], jumpsToLabel: List[(CfgNode, String)])

A control flow graph that is under construction, consisting of:

Attributes

breaks

unresolved breaks collected along the way together with an integer value which indicates the number of loop/switch levels to break

caseLabels

labels beginning with "case"

continues

unresolved continues collected along the way together with an integer value which indicates the number of loop/switch levels after which to continue

edges

control flow edges between nodes of the code property graph.

entryNode

the control flow graph's first node, that is, the node to which a CFG that appends this CFG should attach itself to.

fringe

nodes of the CFG for which an outgoing edge type is already known but the destination node is not. These nodes are connected when another CFG is appended to this CFG. In addition to these three core building blocks, we store labels and jump statements that have not been resolved and may be resolvable as parent sub trees or sibblings are translated.

jumpsToLabel

unresolved gotos, labeled break and labeld continues collected along the way

labeledNodes

labels contained in the abstract syntax tree from which this CPG was generated

Companion:
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any

Members list

Concise view

Value members

Concrete methods

def ++(other: Cfg): Cfg

Create a new CFG in which other is appended to this CFG. All nodes of the fringe are connected to other's entry node and the new fringe is other's fringe. The diffgraphs, jumps, and labels are the sum of those present in this and other.

Create a new CFG in which other is appended to this CFG. All nodes of the fringe are connected to other's entry node and the new fringe is other's fringe. The diffgraphs, jumps, and labels are the sum of those present in this and other.

Attributes

Upon completing traversal of the abstract syntax tree, this method creates CFG edges between jumps like gotos, labeled breaks, labeled continues and respective labels.

Upon completing traversal of the abstract syntax tree, this method creates CFG edges between jumps like gotos, labeled breaks, labeled continues and respective labels.

Attributes

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product