Skip to content

Commit 992552e

Browse files
committed
Merging r354207:
------------------------------------------------------------------------ r354207 | whitequark | 2019-02-16 23:33:10 +0100 (Sat, 16 Feb 2019) | 16 lines [bindings/go] Fix building on 32-bit systems (ARM etc.) Summary: The patch in https://reviews.llvm.org/D53883 (by me) fails to build on 32-bit systems like ARM. Fix the array size to be less ridiculously large. 2<<20 should still be enough for all practical purposes. Bug: https://bugs.llvm.org/show_bug.cgi?id=40426 Reviewers: whitequark, pcc Reviewed By: whitequark Subscribers: javed.absar, kristof.beyls, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D58030 ------------------------------------------------------------------------ llvm-svn: 354956
1 parent 8eb2ef1 commit 992552e

File tree

1 file changed

+1
-1
lines changed
  • llvm/bindings/go/llvm

1 file changed

+1
-1
lines changed

llvm/bindings/go/llvm/ir.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1263,7 +1263,7 @@ func (v Value) Indices() []uint32 {
12631263
num := C.LLVMGetNumIndices(v.C)
12641264
indicesPtr := C.LLVMGetIndices(v.C)
12651265
// https://github.com/golang/go/wiki/cgo#turning-c-arrays-into-go-slices
1266-
rawIndices := (*[1 << 30]C.uint)(unsafe.Pointer(indicesPtr))[:num:num]
1266+
rawIndices := (*[1 << 20]C.uint)(unsafe.Pointer(indicesPtr))[:num:num]
12671267
indices := make([]uint32, num)
12681268
for i := range indices {
12691269
indices[i] = uint32(rawIndices[i])

0 commit comments

Comments
 (0)