summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Zotov <whitequark@whitequark.org>2014-11-03 11:47:14 +0000
committerPeter Zotov <whitequark@whitequark.org>2014-11-03 11:47:14 +0000
commit2fdec7d71a6ec85e9264164759da93c42a065b37 (patch)
tree3aec066877bf8bb7ee1b28aa301d2ea8b0ffda23
parent164acd5e2d3a76cbb7c12e2f476a5f55e99652a7 (diff)
downloadbcm5719-llvm-2fdec7d71a6ec85e9264164759da93c42a065b37.tar.gz
bcm5719-llvm-2fdec7d71a6ec85e9264164759da93c42a065b37.zip
[OCaml] Fix mismatched CAMLparam/CAMLreturn.
Also, revert r221142--it was an incorrect fix to this bug which fixed tests by accident. llvm-svn: 221149
-rw-r--r--llvm/bindings/ocaml/llvm/llvm_ocaml.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/bindings/ocaml/llvm/llvm_ocaml.c b/llvm/bindings/ocaml/llvm/llvm_ocaml.c
index aaffb560116..63c235d3ead 100644
--- a/llvm/bindings/ocaml/llvm/llvm_ocaml.c
+++ b/llvm/bindings/ocaml/llvm/llvm_ocaml.c
@@ -750,7 +750,7 @@ CAMLprim value llvm_float_of_const(LLVMValueRef Const)
if (LLVMIsAConstantFP(Const)) {
Result = LLVMConstRealGetDouble(Const, &LosesInfo);
if (LosesInfo)
- return Val_int(0);
+ CAMLreturn(Val_int(0));
Option = alloc(1, 0);
Field(Option, 0) = caml_copy_double(Result);
@@ -1590,12 +1590,11 @@ CAMLprim value llvm_position_builder(value Pos, value B) {
}
/* llbuilder -> llbasicblock */
-CAMLprim value llvm_insertion_block(value B) {
- CAMLparam0();
+CAMLprim LLVMBasicBlockRef llvm_insertion_block(value B) {
LLVMBasicBlockRef InsertBlock = LLVMGetInsertBlock(Builder_val(B));
if (!InsertBlock)
caml_raise_not_found();
- CAMLreturn((value) InsertBlock);
+ return InsertBlock;
}
/* llvalue -> string -> llbuilder -> unit */
OpenPOWER on IntegriCloud