-
Notifications
You must be signed in to change notification settings - Fork 35
Description
The issue was reported here
The bug arises from the use of generic integer types (int) in test cases involving large numerical values that exceed the range of a 32-bit integer.
In Go, the size of the int type depends on the platform, this behavior causes inconsistencies when handling large integers, such as -9223372036854775808 and 9007199254740993.
On 32-bit systems, these values cannot be represented correctly as int, leading to potential overflow or truncation errors. By explicitly using the int64 type in the affected test cases, the code ensures proper handling and representation of large integers across all platforms, avoiding platform-specific bugs and improving the reliability of the tests.
This bug also affects yaml/go-yaml
We can face the issue by running the following command
GOARCH=386 go test ./...
# go.yaml.in/yaml/v4_test [go.yaml.in/yaml/v4.test]
./decode_test.go:247:25: cannot use -9223372036854775808 (untyped int constant) as int value in map literal (overflows)We can apply @arthurbdiniz fix available here.
We will also have to make sure we launch the CI on i386 arch and other base 32-bit architecture.