We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
package main import ( "bytes" "fmt" "unsafe" ) func main() { b := make([]byte, 128) for i := range b { b[i] = 1 } if bytes.IndexByte(b, 0) != -1 { panic("found 0") } for i := range b { b[i] = 0 c := b *(*int)(unsafe.Pointer(uintptr(unsafe.Pointer(&c)) + unsafe.Sizeof(uintptr(0)))) = 1<<31 - 1 if bytes.IndexByte(c, 0) != i { fmt.Printf("missing 0 at %d\n", i) } b[i] = 1 } }
This succeeds with GOOS=darwin GOARCH=amd64 and GOOS=darwin GOARCH=386 but fails with GOOS=nacl GOARCH=amd64p32 for all i >= 15.
GOOS=darwin GOARCH=amd64
GOOS=darwin GOARCH=386
GOOS=nacl GOARCH=amd64p32
The problem is overflow in runtime·indexbytebody.
This is what was causing the trybot failures in CL 97523.
The text was updated successfully, but these errors were encountered:
Change https://golang.org/cl/97802 mentions this issue: runtime: fix amd64p32 indexbytes in presence of overflow
runtime: fix amd64p32 indexbytes in presence of overflow
Sorry, something went wrong.
aa9c1a8
No branches or pull requests
This succeeds with
GOOS=darwin GOARCH=amd64
andGOOS=darwin GOARCH=386
but fails withGOOS=nacl GOARCH=amd64p32
for all i >= 15.The problem is overflow in runtime·indexbytebody.
This is what was causing the trybot failures in CL 97523.
The text was updated successfully, but these errors were encountered: