Language-Independent Code Analysis for .NET Memory Safety

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing code analysis tools for programs supported by the.NET framework face interoperability issues due to limited cross-language libraries, making it difficult to detect memory safety faults such as null pointer dereferences and memory leaks effectively.

Innovation Solution

A language interoperability system is developed to convert.NET framework programs into an intermediate language, generate a language-independent representation, and utilize an interprocedural static code analyzer like Infer to detect memory safety faults by analyzing control flow graphs and type environments.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Adaptability or versatility

If existing code analysis tools are used for .NET framework programs, then analysis can be performed, but interoperability issues occur due to limited cross-language libraries

Engineering Contradiction:
Improvelanguage compatibilityVSAvoiddetection accuracy
Core Design Contradiction:
Adaptability or versatilityVSReliability

Solution Approach 1:

The patent introduces an intermediate representation (IR) as a mediator between .NET programs and the code analysis tool. The IR captures language-independent program properties such as control flow graphs and type environments, enabling the analysis tool to process .NET code without direct language support. This intermediary layer resolves the contradiction by decoupling the analysis engine from language-specific implementations, thereby improving both adaptability and reliability.

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The analysis system is segmented into distinct components: a front end that converts .NET programs into intermediate representation, and a back end that performs the actual analysis. This segmentation allows each component to specialize in its function - the front end handles language-specific conversion while the back end focuses on language-independent analysis, resolving the interoperability issue while maintaining detection accuracy.

Inventive Principle:
Principle #1Segmentation

2Productivity

If program size increases to tens of millions of lines of code, then functionality is enhanced, but bug detection becomes complicated and resource-intensive

Engineering Contradiction:
Improvecode processing capacityVSAvoidanalysis complexity
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The patent applies segmentation by dividing the analysis of large programs into manageable units through control flow graphs. The program is broken down into basic blocks and control flow relationships, allowing the analysis to process tens of millions of lines of code systematically. This segmentation reduces analysis complexity by transforming an overwhelming monolithic task into structured, manageable components.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent transforms the analysis from a linear text-based approach to a graphical dimension using control flow graphs. By representing code structure in a two-dimensional graph format with nodes and edges, the system can visualize and analyze complex program structures more efficiently, reducing the complexity burden of processing large codebases.

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

3Measurement precision

If testing is performed on all possible user scenarios, then bug detection completeness is improved, but resource consumption becomes impossible to sustain

Engineering Contradiction:
Improvebug detection completenessVSAvoidresource consumption
Core Design Contradiction:
Measurement precisionVSQuantity of substance

Solution Approach 1:

The patent applies partial action by performing static analysis on specific program properties (control flow, type environments) rather than executing all possible user scenarios. This approach achieves sufficient bug detection completeness for memory safety faults without the prohibitive resource consumption of exhaustive testing, by focusing analysis on the most critical aspects of program behavior.

Inventive Principle:
Principle #16Partial or excessive action

Solution Approach 2:

The system performs preliminary static analysis before program execution to identify potential memory safety faults. By analyzing control flow graphs and type environments in advance, the system detects bugs that would otherwise require exhaustive runtime testing, thereby reducing the need for resource-intensive comprehensive testing while maintaining detection completeness.

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentEP4150461B1Language interoperability to automate code analysis
Publication Date: 2026.03.11 MICROSOFT TECHNOLOGY LICENSING LLC
  • EP4150461B1 patent drawingFigure 1
  • EP4150461B1 patent drawingFigure 2
  • EP4150461B1 patent drawingFigure 3

AI summary

Language interoperability between source code programs not compatible with an interprocedural static code analyzer is achieved through language-independent representations of the programs. The source code programs are transformed into respective intermediate language instructions from which a language-independent control flow graph and a language-independent type environment is created. A program compatible with the interprocedural static code analyzer is generated from the language-independent control flow graph and the language-independent type environment in order to utilize the interprocedural static code analyzer to detect memory safety faults.