dibyendumajumdar / dmr_c

dmr_C is a C parser and JIT compiler with LLVM, Eclipse OMR and NanoJIT backends
Other
52 stars 2 forks source link

Review error handling to avoid program termination on error #2

Open dibyendumajumdar opened 7 years ago

dibyendumajumdar commented 7 years ago

The sparse implementation simply exits on encountering errors ... but as a library we cannot do that, so we need an alternative method. Perhaps we can supply an error handler that is called - and this can do a long jmp. We can then allow the caller to handle it. Obviously once an error has occurred then the dmr_C instance should not be used anymore.

dibyendumajumdar commented 7 years ago

The error handling has been improved so that we detect issues and gracefully exit rather than asserting or aborting. We also try to generate more meaningful error messages and point the offending linear instruction / line of code if possible. But still more work is needed