Fix bug in constructing Ocaml option types in the bindings.

llvm-svn: 44704
This commit is contained in:
Gordon Henriksen 2007-12-08 16:55:43 +00:00
parent ff87f05e43
commit 05481d91be
2 changed files with 3 additions and 3 deletions

View File

@ -32,7 +32,7 @@ CAMLprim value llvm_verify_module(LLVMModuleRef M) {
if (0 == Result) {
Option = Val_int(0);
} else {
Option = alloc(1, 1);
Option = alloc(1, 0);
String = copy_string(Message);
Store_field(Option, 0, String);
}

View File

@ -410,7 +410,7 @@ CAMLprim value llvm_lookup_global(value Name, LLVMModuleRef M) {
CAMLparam1(Name);
LLVMValueRef GlobalVar;
if ((GlobalVar = LLVMGetNamedGlobal(M, String_val(Name)))) {
value Option = alloc(1, 1);
value Option = alloc(1, 0);
Field(Option, 0) = (value) GlobalVar;
CAMLreturn(Option);
}
@ -487,7 +487,7 @@ CAMLprim value llvm_lookup_function(value Name, LLVMModuleRef M) {
CAMLparam1(Name);
LLVMValueRef Fn;
if ((Fn = LLVMGetNamedFunction(M, String_val(Name)))) {
value Option = alloc(1, 1);
value Option = alloc(1, 0);
Field(Option, 0) = (value) Fn;
CAMLreturn(Option);
}