[OCaml] Use LLVMCreateMessage with constant strings when calling llvm_raise
authorJeroen Ketema <j.ketema@imperial.ac.uk>
Fri, 1 Apr 2016 07:56:17 +0000 (07:56 +0000)
committerJeroen Ketema <j.ketema@imperial.ac.uk>
Fri, 1 Apr 2016 07:56:17 +0000 (07:56 +0000)
commitb7f633b8d3c2c107f364c83243b2c5290f9e5769
treecc2d20f29b30dd4d5b69d81a1923a4f73d6233ce
parentc110fbc2137e21e06161b2139775817c463e2ba7
[OCaml] Use LLVMCreateMessage with constant strings when calling llvm_raise

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.

Differential Revision: http://reviews.llvm.org/D18675

llvm-svn: 265116
llvm/bindings/ocaml/analysis/analysis_ocaml.c
llvm/bindings/ocaml/bitreader/bitreader_ocaml.c
llvm/bindings/ocaml/linker/linker_ocaml.c
llvm/bindings/ocaml/llvm/llvm_ocaml.c