summaryrefslogtreecommitdiffstats
path: root/llvm/bindings
diff options
context:
space:
mode:
authorPeter Zotov <whitequark@whitequark.org>2014-11-03 09:51:44 +0000
committerPeter Zotov <whitequark@whitequark.org>2014-11-03 09:51:44 +0000
commit918617000fa675d6c104a1c1d8dfe74d28bceb63 (patch)
treee31c84bea02b4abaeb72b4c8890a40ce10fd1629 /llvm/bindings
parent5a02784ec7a0c3c95ebae9c64e2d6a24184e49e2 (diff)
downloadbcm5719-llvm-918617000fa675d6c104a1c1d8dfe74d28bceb63.tar.gz
bcm5719-llvm-918617000fa675d6c104a1c1d8dfe74d28bceb63.zip
[OCaml] Initialize local roots prior to raising.
On 4.02, the OCaml unwinder otherwise gets confused and segfaults. llvm-svn: 221142
Diffstat (limited to 'llvm/bindings')
-rw-r--r--llvm/bindings/ocaml/llvm/llvm_ocaml.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/bindings/ocaml/llvm/llvm_ocaml.c b/llvm/bindings/ocaml/llvm/llvm_ocaml.c
index b43b3750734..d8682880033 100644
--- a/llvm/bindings/ocaml/llvm/llvm_ocaml.c
+++ b/llvm/bindings/ocaml/llvm/llvm_ocaml.c
@@ -1590,11 +1590,12 @@ CAMLprim value llvm_position_builder(value Pos, value B) {
}
/* llbuilder -> llbasicblock */
-CAMLprim LLVMBasicBlockRef llvm_insertion_block(value B) {
+CAMLprim value llvm_insertion_block(value B) {
+ CAMLparam0();
LLVMBasicBlockRef InsertBlock = LLVMGetInsertBlock(Builder_val(B));
if (!InsertBlock)
- raise_not_found();
- return InsertBlock;
+ caml_raise_not_found();
+ CAMLreturn((value) InsertBlock);
}
/* llvalue -> string -> llbuilder -> unit */
OpenPOWER on IntegriCloud