mirror of
https://github.com/golang/go.git
synced 2026-04-04 02:10:08 +09:00
For instructions that clobber both of their input registers, make sure we don't clobber the same register twice when both input registers are the same. This is rare, but it can happen. Fixes #77604 Change-Id: I794249cf43a8cc4ab3262055daef9193e2442f73 Reviewed-on: https://go-review.googlesource.com/c/go/+/745621 Reviewed-by: Keith Randall <khr@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Jorropo <jorropo.pgm@gmail.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
21 lines
360 B
Go
21 lines
360 B
Go
// compile
|
|
|
|
// Copyright 2026 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.
|
|
|
|
// Issue 77604: compiler crash when source and destination
|
|
// of copy are the same address.
|
|
|
|
package p
|
|
|
|
type T struct {
|
|
a [192]byte
|
|
}
|
|
|
|
func f(x *T) {
|
|
i := any(x)
|
|
y := i.(*T)
|
|
*y = *x
|
|
}
|