The llvm_string_of_message function, called by llvm_raise, calls LLVMDisposeMessage, which expects the message to be dynamically allocated; it fails freeing the message otherwise. So always dynamically allocate with LLVMCreateMessage.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
By the way, it would be wonderful if you found a moment to add support for LLVMContextSetDiagnosticHandler—it's in my backlog for a while, but I'm unlikely to get to it soon... right now the error messages from the OCaml bindings are quite useless.
Comment Actions
Yeah something needs to be done with LLVMContextSetDiagnosticHandler anyway, as two regression tests currently fail because no handler is installed. I might do an easy fix for that first (just to get the tests back in working order) and then revisit how to properly expose the handlers.