Commit 7a2daa7d authored by Ian Lance Taylor's avatar Ian Lance Taylor

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

R=rsc
CC=golang-dev
https://golang.org/cl/2084041
parent b433552e
......@@ -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 {
......
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment