1
0
mirror of https://github.com/golang/go synced 2024-11-21 15:54:43 -07:00

proc, eval: Don't assign address of an array to a slice.

R=rsc
CC=golang-dev
https://golang.org/cl/2084041
This commit is contained in:
Ian Lance Taylor 2010-08-30 13:47:40 -07:00
parent b433552ebc
commit 7a2daa7d3a
2 changed files with 3 additions and 3 deletions

View File

@ -71,7 +71,7 @@ func (r *amd64Regs) SetSP(val Word) os.Error {
return r.setter(&r.PtraceRegs)
}
func (r *amd64Regs) Names() []string { return &names }
func (r *amd64Regs) Names() []string { return names[0:] }
func (r *amd64Regs) Get(i int) Word {
switch i {

View File

@ -205,7 +205,7 @@ func toValue(val interface{}) Value {
type testFunc struct{}
func (*testFunc) NewFrame() *Frame { return &Frame{nil, &[2]Value{}} }
func (*testFunc) NewFrame() *Frame { return &Frame{nil, make([]Value, 2)} }
func (*testFunc) Call(t *Thread) {
n := t.f.Vars[0].(IntValue).Get(t)
@ -217,7 +217,7 @@ func (*testFunc) Call(t *Thread) {
type oneTwoFunc struct{}
func (*oneTwoFunc) NewFrame() *Frame { return &Frame{nil, &[2]Value{}} }
func (*oneTwoFunc) NewFrame() *Frame { return &Frame{nil, make([]Value, 2)} }
func (*oneTwoFunc) Call(t *Thread) {
t.f.Vars[0].(IntValue).Set(t, 1)