diff options
| author | whitequark <whitequark@whitequark.org> | 2019-02-16 22:33:10 +0000 |
|---|---|---|
| committer | whitequark <whitequark@whitequark.org> | 2019-02-16 22:33:10 +0000 |
| commit | 21da42945b72719b69939381feff081491f5bdca (patch) | |
| tree | 2920ab6bcabe27d9c4eea94e1d127d3d443485d0 /llvm/bindings/go | |
| parent | b81d715cd25178d413431258667861485bb0ff89 (diff) | |
| download | bcm5719-llvm-21da42945b72719b69939381feff081491f5bdca.tar.gz bcm5719-llvm-21da42945b72719b69939381feff081491f5bdca.zip | |
[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: 354207
Diffstat (limited to 'llvm/bindings/go')
| -rw-r--r-- | llvm/bindings/go/llvm/ir.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/bindings/go/llvm/ir.go b/llvm/bindings/go/llvm/ir.go index c07a1b4ee5c..4682cf35ddb 100644 --- a/llvm/bindings/go/llvm/ir.go +++ b/llvm/bindings/go/llvm/ir.go @@ -1262,7 +1262,7 @@ func (v Value) Indices() []uint32 { num := C.LLVMGetNumIndices(v.C) indicesPtr := C.LLVMGetIndices(v.C) // https://github.com/golang/go/wiki/cgo#turning-c-arrays-into-go-slices - rawIndices := (*[1 << 30]C.uint)(unsafe.Pointer(indicesPtr))[:num:num] + rawIndices := (*[1 << 20]C.uint)(unsafe.Pointer(indicesPtr))[:num:num] indices := make([]uint32, num) for i := range indices { indices[i] = uint32(rawIndices[i]) |

