[llvm] r354207 - [bindings/go] Fix building on 32-bit systems (ARM etc.)

Hans Wennborg via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 27 02:14:08 PST 2019


Merged to release_80 in r354956.

On Sat, Feb 16, 2019 at 11:32 PM whitequark via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
>
> Author: whitequark
> Date: Sat Feb 16 14:33:10 2019
> New Revision: 354207
>
> URL: http://llvm.org/viewvc/llvm-project?rev=354207&view=rev
> Log:
> [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
>
> Modified:
>     llvm/trunk/bindings/go/llvm/ir.go
>
> Modified: llvm/trunk/bindings/go/llvm/ir.go
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/go/llvm/ir.go?rev=354207&r1=354206&r2=354207&view=diff
> ==============================================================================
> --- llvm/trunk/bindings/go/llvm/ir.go (original)
> +++ llvm/trunk/bindings/go/llvm/ir.go Sat Feb 16 14:33:10 2019
> @@ -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])
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits


More information about the llvm-commits mailing list