[compiler-hacking] Warnings for uncaught exceptions

Nik Sultana ns441 at cam.ac.uk
Sun Jul 31 20:28:27 BST 2016


I'm not sure if there already exists such functionality for OCaml, but 
thought that adapting this work to OCaml from SML might make an 
interesting project for somebody on this list:

"Estimating uncaught exceptions in Standard ML programs from type-based 
equations" by Yi et al.
<abstract>
We present a static analysis that detects potential runtime exceptions 
that are raised and never handled inside Standard ML (SML) programs. 
Contrary to our earlier method (Yi, 1994) based on abstract 
interpretation, where the input program's control flow is simultaneously 
computed while our exception analysis progresses, we separate the two 
phases in a manner similar to conventional data flow analysis. Before 
the exception analysis begins, we first estimate the input program's 
control flow from the type information from SML/NJ compiler. Based on 
this call-graph structure, exception flow is specified as a set of 
equations, whose solution is computed using an iterative least fixpoint 
method. A prototype of this analysis is applied to two realistic SML 
programs (ML-LEX and OR-SML core) and is 3 or 40 times faster than the 
earlier method and saves memory by 35 or 65 percent
</abstract>

The full paper's at 
http://ieeexplore.ieee.org/xpl/articleDetails.jsp?arnumber=544613


More information about the Cam-compiler-hacking mailing list