OSDN Git Service

[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)
commitf4430ca01de933e7608a244915c33c76723474a2
tree3f52ca3dbf3704ea34ed0a04a3a3e3a645dcc9a2
parent145384cb84d3725f73aa45362c7c97795c0dd6f5
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265116 91177308-0d34-0410-b5e6-96231b3b80d8
bindings/ocaml/analysis/analysis_ocaml.c
bindings/ocaml/bitreader/bitreader_ocaml.c
bindings/ocaml/linker/linker_ocaml.c
bindings/ocaml/llvm/llvm_ocaml.c