Skip to content

Commit

Permalink
[OCaml] Fix mismatched CAMLparam/CAMLreturn.
Browse files Browse the repository at this point in the history
Also, revert r221142--it was an incorrect fix to this bug
which fixed tests by accident.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221149 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
whitequark committed Nov 3, 2014
1 parent 8e003cd commit 89a66f4
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions bindings/ocaml/llvm/llvm_ocaml.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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 */
Expand Down

0 comments on commit 89a66f4

Please sign in to comment.