diff options
author | Jeroen Ketema <j.ketema@imperial.ac.uk> | 2016-04-01 07:56:17 +0000 |
---|---|---|
committer | Jeroen Ketema <j.ketema@imperial.ac.uk> | 2016-04-01 07:56:17 +0000 |
commit | f4430ca01de933e7608a244915c33c76723474a2 (patch) | |
tree | 3f52ca3dbf3704ea34ed0a04a3a3e3a645dcc9a2 /bindings/ocaml/llvm/llvm_ocaml.c | |
parent | 145384cb84d3725f73aa45362c7c97795c0dd6f5 (diff) |
[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
Diffstat (limited to 'bindings/ocaml/llvm/llvm_ocaml.c')
-rw-r--r-- | bindings/ocaml/llvm/llvm_ocaml.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/bindings/ocaml/llvm/llvm_ocaml.c b/bindings/ocaml/llvm/llvm_ocaml.c index b4c47e7475e..925f3bdb600 100644 --- a/bindings/ocaml/llvm/llvm_ocaml.c +++ b/bindings/ocaml/llvm/llvm_ocaml.c @@ -19,6 +19,7 @@ #include <stdlib.h> #include <string.h> #include "llvm-c/Core.h" +#include "llvm-c/Support.h" #include "caml/alloc.h" #include "caml/custom.h" #include "caml/memory.h" |