[LLVMdev] aborting on invalid code

Robert Zeh robert.a.zeh at gmail.com
Mon Oct 13 13:10:47 PDT 2008


On Oct 13, 2008, at 1:07 PM, Chris Lattner wrote:
>
> Exceptions have a high cost in terms of code size, binary size, and
> even a bit of execution time.  Also, they don't magically make the
> code safe from any error: code has to be designed specifically to use
> RAII and other techniques to handle exceptions properly.  Reading a C+
> + trade magazines/books about EH topics will give you an idea of the
> complexity involved in doing it right.  Further, as I mentioned up-
> thread, turning aborts into exception throws won't save you from null
> pointer or garbage pointer dereferences.


You can catch the null pointer and garbage pointer dereferences with a  
signal handler (in Linux land, at least), and then invoke your direct  
reporting mechanism with that.  Is the concern that some of the other  
LLVM clients don't have signal handling?

Robert



More information about the llvm-dev mailing list