Front Page

The Liberty Research Group

Interprocedural Exception Analysis for C++ [abstract] (ACM DL, PDF)
Prakash Prabhu, Naoto Maeda, Gogul Balakrishnan, Franjo Ivancic, and Aarti Gupta
Proceedings of the 25th European Conference on Object-Oriented Programming (ECOOP), July 2011.

C++ Exceptions provide a useful way for dealing with abnormal program behavior, but often lead to irregular interprocedural control flow that complicates compiler optimizations and static analysis. In this paper, we present an interprocedural exception analysis and transformation framework for C++ that captures the control-flow induced by exceptions and transforms it into an exception-free program that is amenable for precise static analysis. Control-flow induced by exceptions is captured in a modular interprocedural exception control-flow graph (IECFG). The IECFG is further refined using a novel interprocedural dataflow analysis algorithm based on a compact representation for a set of types called the Signed-TypeSet domain. The results of the interprocedural analysis are used by a lowering transformation to generate an exception-free C++ program. The lowering transformations do not affect the precision and accuracy of any subsequent program analysis. Our framework handles all the features of synchronous C++ exception handling and all exception sub-typing rules from the C++0x standard. We demonstrate two applications of our framework: (a) automatic inference of exception specifications for C++ functions for documentation, and (b) checking the ``no-throw'' and ``no-leak'' exception-safety properties.