Skip to content

Overflow on 32 bits platforms. #1

@kevina

Description

@kevina

I am not sure why this wasn't a problem before but this constant:

const MaxLength = 1 << 32

should probably change to

const MaxLength = math.MaxInt32

Otherwise we will get these errors:

[go-ipfs] Running shell script
+ go build -i -ldflags=-X github.com/ipfs/go-ipfs/repo/config.CurrentCommit=pr-5553-5 -o cmd/ipfs/ipfs github.com/ipfs/go-ipfs/cmd/ipfs
# gx/ipfs/QmUQy76yspPa3fRyY3GzXFTg9n8JVwFru6ue3KFRt4MeTw/go-buffer-pool
../../../gx/ipfs/QmUQy76yspPa3fRyY3GzXFTg9n8JVwFru6ue3KFRt4MeTw/go-buffer-pool/pool.go:55:12: constant 4294967296 overflows int
../../../gx/ipfs/QmUQy76yspPa3fRyY3GzXFTg9n8JVwFru6ue3KFRt4MeTw/go-buffer-pool/pool.go:68:31: constant 4294967296 overflows int
script returned exit code 2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions