mirror of
https://github.com/golang/go
synced 2024-11-13 18:20:32 -07:00
6ec1809b83
The issue 12226 has been caused by the allocation of the same register for the equality check of two byte values. The code in cgen.go freed the register for the second operand before the allocation of the register for the first operand. Fixes #12226 Change-Id: Ie4dc33a488bd48a17f8ae9b497fd63c1ae390555 Reviewed-on: https://go-review.googlesource.com/13771 Reviewed-by: Russ Cox <rsc@golang.org>
16 lines
331 B
Go
16 lines
331 B
Go
// run
|
|
|
|
// Copyright 2015 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package main
|
|
|
|
import "fmt"
|
|
|
|
func main() {
|
|
if []byte("foo")[0] == []byte("b")[0] {
|
|
fmt.Println("BUG: \"foo\" and \"b\" appear to have the same first byte")
|
|
}
|
|
}
|