EnSoft

High Assurance Software

XCSG Compendium — Interprocedural Flows

--

Find the index for the Compendium here.

In this article, we will cover aspects related to interprocedural flows in XCSG. Interprocedural flow is created due to calls between functions or global variable accesses. We will first discuss how XCSG represents interprocedural flow of Control i.e., Call Graphs and callsites in a function. Then we will discuss concepts related to interprocedural data flow via parameters, returns, and globals.

  • XCSG.Function: An XCSG.Node that represents a function.
  • XCSG.Call: An XCSG.Edge a->b that connects two XCSG.Function nodes where function a calls function b.
  • XCSG.CallSite: An XCSG.DataFlow_Node that represents a callsite, location where the invocation happens. This node is always contained within the XCSG.ControlFlow_Node representing the corresponding execution statement.
  • XCSG.InvokedFunction: An XCSG.Edge that connects a XCSG.CallSite node to the XCSG.Function node representing the function invoked at the callsite.

Query example:
var forwardCallTree = universe.edges(XCSG.Call).forward(<function>)
- This query transitively computes the forward call tree rooted at a given <function>. Similarly, replacing forward with reverse computes the reverse call tree for <function>.

Let’s now look at tags related to interprocedural transfer of data flow.

  • XCSG.Parameter: An XCSG.DataFlow_Node that represents a formal parameter as declared in the function definition.
  • XCSG.ParameterPass: An XCSG.DataFlow_Node that represents the actual parameter that is passed at a callsite.
  • XCSG.PassedTo: An XCSG.DataFlow_Edge that connects an XCSG.ParameterPass node to corresponding XCSG.Parameter node.
  • XCSG.GlobalVariable: An XCSG.DataFlow_Node representing a global variable.
  • XCSG.ReturnValue: An XCSG.DataFlow_Node that represents the value returned by a function. It is contained in the XCSG.ControlFlow_Node corresponding to the return statement that returns the value.
  • XCSG.InterproceduralDataFlow: An XCSG.DataFlow_Edge that represents an interprocedural data flow — via parameters, or via return value, or via global variable read/writes.

--

--

No responses yet