From 7e40627a0e595aa321efaf44f8507b678ee5eb1e Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Mon, 11 Apr 2016 13:17:52 -0700 Subject: [PATCH] cmd/compile: zero all three argstorage slots These changes were missed when going from 2 to 3 argstorage slots. https://go-review.googlesource.com/20296/ Change-Id: I930a307bb0b695bf1ae088030c9bbb6d14ca31d2 Reviewed-on: https://go-review.googlesource.com/21841 Reviewed-by: Brad Fitzpatrick Reviewed-by: Josh Bleecher Snyder --- src/cmd/compile/internal/ssa/func.go | 10 ++++++++-- src/cmd/compile/internal/ssa/value.go | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/cmd/compile/internal/ssa/func.go b/src/cmd/compile/internal/ssa/func.go index 6e47b7f19c..8dd75f6093 100644 --- a/src/cmd/compile/internal/ssa/func.go +++ b/src/cmd/compile/internal/ssa/func.go @@ -284,7 +284,10 @@ func (b *Block) NewValue2I(line int32, op Op, t Type, auxint int64, arg0, arg1 * func (b *Block) NewValue3(line int32, op Op, t Type, arg0, arg1, arg2 *Value) *Value { v := b.Func.newValue(op, t, b, line) v.AuxInt = 0 - v.Args = []*Value{arg0, arg1, arg2} + v.Args = v.argstorage[:3] + v.argstorage[0] = arg0 + v.argstorage[1] = arg1 + v.argstorage[2] = arg2 arg0.Uses++ arg1.Uses++ arg2.Uses++ @@ -295,7 +298,10 @@ func (b *Block) NewValue3(line int32, op Op, t Type, arg0, arg1, arg2 *Value) *V func (b *Block) NewValue3I(line int32, op Op, t Type, auxint int64, arg0, arg1, arg2 *Value) *Value { v := b.Func.newValue(op, t, b, line) v.AuxInt = auxint - v.Args = []*Value{arg0, arg1, arg2} + v.Args = v.argstorage[:3] + v.argstorage[0] = arg0 + v.argstorage[1] = arg1 + v.argstorage[2] = arg2 arg0.Uses++ arg1.Uses++ arg2.Uses++ diff --git a/src/cmd/compile/internal/ssa/value.go b/src/cmd/compile/internal/ssa/value.go index fd4eb64db1..6c364ad932 100644 --- a/src/cmd/compile/internal/ssa/value.go +++ b/src/cmd/compile/internal/ssa/value.go @@ -185,6 +185,7 @@ func (v *Value) resetArgs() { } v.argstorage[0] = nil v.argstorage[1] = nil + v.argstorage[2] = nil v.Args = v.argstorage[:0] } -- 2.48.1