go source for verification 2026-05-22
This commit is contained in:
33
test/fixedbugs/issue75327.go
Normal file
33
test/fixedbugs/issue75327.go
Normal file
@@ -0,0 +1,33 @@
|
||||
// run
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func main() {
|
||||
defer func() {
|
||||
err := recover()
|
||||
txt := fmt.Sprintf("%s", err)
|
||||
if !strings.HasSuffix(txt, "with length 1") {
|
||||
panic("bad error: " + txt)
|
||||
}
|
||||
}()
|
||||
foo([]uint64{0})
|
||||
}
|
||||
|
||||
//go:noinline
|
||||
func foo(haystack []uint64) {
|
||||
for n := range len(haystack) {
|
||||
_ = n
|
||||
_ = haystack[1]
|
||||
}
|
||||
|
||||
xxx := haystack[0:len(haystack)]
|
||||
sink(xxx)
|
||||
}
|
||||
|
||||
//go:noinline
|
||||
func sink([]uint64) {}
|
||||
Reference in New Issue
Block a user