llvm.org GIT mirror llvm / 7405c60
[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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354207 91177308-0d34-0410-b5e6-96231b3b80d8 whitequark 4 months ago
1 changed file(s) with 1 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
12611261 num := C.LLVMGetNumIndices(v.C)
12621262 indicesPtr := C.LLVMGetIndices(v.C)
12631263 // https://github.com/golang/go/wiki/cgo#turning-c-arrays-into-go-slices
1264 rawIndices := (*[1 << 30]C.uint)(unsafe.Pointer(indicesPtr))[:num:num]
1264 rawIndices := (*[1 << 20]C.uint)(unsafe.Pointer(indicesPtr))[:num:num]
12651265 indices := make([]uint32, num)
12661266 for i := range indices {
12671267 indices[i] = uint32(rawIndices[i])