Interprocedural Exception Control Flow Graph for C++ Analysis

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing C++ compiler frameworks fail to precisely model interprocedural control flow induced by exceptions, leading to conservative assumptions and reduced precision in static analysis, as they do not perform interprocedural analysis and rely on opaque runtime systems.

Innovation Solution

An interprocedural exception analysis and transformation framework that constructs an interprocedural exception control flow graph (IECFG) and uses the Signed-TypeSet domain for compact representation of program types, allowing for precise modeling of exceptions and generation of exception-free code without non-local jumps or opaque runtime systems.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If standard C++ compiler frameworks are used to handle exceptions, then the program can execute with exception handling capability, but the static analysis precision deteriorates due to conservative assumptions and opaque runtime systems

Engineering Contradiction:
Improveexception handling capabilityVSAvoidstatic analysis precision
Core Design Contradiction:
ReliabilityVSMeasurement precision

Solution Approach 1:

The patent introduces an intermediary representation called Exception Control Flow Graph (ECFG) that mediates between the original C++ code with exceptions and the static analysis tools. The ECFG explicitly models exception propagation paths and destructor calls, making the control flow induced by exceptions visible and analyzable without requiring opaque runtime system assumptions.

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The patent replaces the mechanical reliance on opaque C++ runtime systems with a formal symbolic representation system. Instead of depending on runtime exception handling mechanisms that are invisible to static analyzers, the patent substitutes them with an explicit ECFG model that captures exception behavior in a form amenable to precise static analysis.

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

2Measurement precision

If interprocedural exception analysis is performed to capture precise control flow, then the static analysis precision improves, but the computational complexity increases

Engineering Contradiction:
Improveexception control flow modeling precisionVSAvoidanalysis framework complexity
Core Design Contradiction:
Measurement precisionVSDevice complexity

Solution Approach 1:

The patent segments the complex interprocedural exception analysis into manageable components: (1) construction of per-function ECFGs that capture local exception handling, (2) interprocedural propagation of exception information through call graphs, and (3) synthesis of global exception control flow. This segmentation makes the overall complex task tractable by breaking it into smaller, more manageable analysis steps.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent adds a new dimension to traditional control flow graphs by incorporating exception-specific control flow edges alongside normal control flow edges. The ECFG extends the conventional CFG by adding exceptional edges that represent exception propagation paths, creating a multi-dimensional view of program control flow that captures both normal and exceptional execution paths.

Inventive Principle:
Principle #17Another dimension (Dimensionality change)

3Ease of manufacture

If the ECFG construction is made modular to support separate compilation units, then the ease of manufacture improves, but the measurement precision may be reduced due to limited visibility across compilation boundaries

Engineering Contradiction:
Improvemodularity for separate compilationVSAvoidexception propagation tracking precision
Core Design Contradiction:
Ease of manufactureVSMeasurement precision

Solution Approach 1:

The patent performs preliminary analysis within each compilation unit to construct local ECFGs and compute exception information that can be exported. By pre-computing and exporting exception propagation summaries from each module, the system enables subsequent interprocedural analysis to reconstruct precise global exception control flow even when modules are compiled separately, thus maintaining precision while enabling modularity.

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS8719802B2Interprocedural exception method
Publication Date: 2014.05.06 NEC CORP
  • US8719802B2 patent drawing
  • US8719802B2 patent drawing
  • US8719802B2 patent drawing

AI summary

An interprocedural exception analysis and transformation framework for computer programming languages such as C++ that (1) captures the control-flow induced by exceptions precisely, and (2) transforms the given computer program into an exception-free program that is amenable for precise static analysis, verification, and optimizations.