mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: fix static-initialization compilation failure
Fixes #13263. Change-Id: Ie1cafc62b6bfe6c5381c35d9a95563267b4cc9b0 Reviewed-on: https://go-review.googlesource.com/33970 Reviewed-by: Robert Griesemer <gri@golang.org> Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com> Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
8adff32bac
commit
749720a036
2 changed files with 18 additions and 1 deletions
|
|
@ -295,7 +295,9 @@ func staticcopy(l *Node, r *Node, out *[]*Node) bool {
|
||||||
if staticcopy(l, r, out) {
|
if staticcopy(l, r, out) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
*out = append(*out, nod(OAS, l, r))
|
// We may have skipped past one or more OCONVNOPs, so
|
||||||
|
// use conv to ensure r is assignable to l (#13263).
|
||||||
|
*out = append(*out, nod(OAS, l, conv(r, l.Type)))
|
||||||
return true
|
return true
|
||||||
|
|
||||||
case OLITERAL:
|
case OLITERAL:
|
||||||
|
|
|
||||||
15
test/fixedbugs/issue13263.go
Normal file
15
test/fixedbugs/issue13263.go
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
// compile
|
||||||
|
|
||||||
|
// Copyright 2016 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 b
|
||||||
|
|
||||||
|
var (
|
||||||
|
x uint
|
||||||
|
y = x
|
||||||
|
z = uintptr(y)
|
||||||
|
a = uint32(y)
|
||||||
|
b = uint64(y)
|
||||||
|
)
|
||||||
Loading…
Add table
Add a link
Reference in a new issue