[LLVMdev] C++ Exception Handling Problem

Nyx mcheva at cs.mcgill.ca
Mon Mar 9 21:36:17 PDT 2009


Hello,

I'm in the process of creating a JIT and I've run into a problem with
exception handling. The situation I'm in is that my program will JIT
functions, which will call native C++ functions (part of the run-time
support). These native functions can throw exceptions. However, I don't
actually want to handle these exceptions in the JITted functions. There are
already try/catch blocks in place in the C++ function that calls the JITted
functions. 

The problem I run into is that when exceptions are thrown, they aren't
caught anywhere. My program crashes with an error message: "terminate called
after throwing an instance of 'RunError'". Where RunError is the exception
type. Hence, the exceptions aren't getting caught where they should be.

What I'd like to know is how I can fix this situation, so that if my C++
runtime support functions throw an exception, it can unwind the JITted
functions properly, and these functions can ensure that the proper native
C++ catch block receives the exception. I looked at the LLVM docs, but I'm
still puzzled.
-- 
View this message in context: http://www.nabble.com/C%2B%2B-Exception-Handling-Problem-tp22427938p22427938.html
Sent from the LLVM - Dev mailing list archive at Nabble.com.




More information about the llvm-dev mailing list