Static Analysis

Volume 3672 of the series Lecture Notes in Computer Science pp 155-170

Using Dependent Types to Certify the Safety of Assembly Code

  • Matthew HarrenAffiliated withComputer Science Division, University of California
  • , George C. NeculaAffiliated withComputer Science Division, University of California

* Final gross prices may vary according to local VAT.

Get Access


There are many source-level analyses or instrumentation tools that enforce various safety properties. In this paper we present an infrastructure that can be used to check independently that the assembly output of such tools has the desired safety properties. By working at assembly level we avoid the complications with unavailability of source code, with source-level parsing, and we certify the code that is actually deployed.

The novel feature of the framework is an extensible dependently-typed framework that supports type inference and mutation of dependent values in memory. The type system can be extended with new types as needed for the source-level tool that is certified. Using these dependent types, we are able to express the invariants enforced by CCured, a source-level instrumentation tool that guarantees type safety in legacy C programs. We can therefore check that the x86 assembly code resulting from compilation with CCured is in fact type-safe.