fix llvm_build_struct_gep for PR6167, patch by
Peter Hawkins!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95644 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/bindings/ocaml/llvm/llvm_ocaml.c b/bindings/ocaml/llvm/llvm_ocaml.c
index 6cc475d..8fdcac5 100644
--- a/bindings/ocaml/llvm/llvm_ocaml.c
+++ b/bindings/ocaml/llvm/llvm_ocaml.c
@@ -1263,11 +1263,10 @@
/* llvalue -> int -> string -> llbuilder -> llvalue */
CAMLprim LLVMValueRef llvm_build_struct_gep(LLVMValueRef Pointer,
- value Indices, value Name,
+ value Index, value Name,
value B) {
- return LLVMBuildInBoundsGEP(Builder_val(B), Pointer,
- (LLVMValueRef *) Op_val(Indices),
- Wosize_val(Indices), String_val(Name));
+ return LLVMBuildStructGEP(Builder_val(B), Pointer,
+ Int_val(Index), String_val(Name));
}
/* string -> string -> llbuilder -> llvalue */