Skip to content

Commit 7e40627

Browse files
committed
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 <[email protected]> Reviewed-by: Josh Bleecher Snyder <[email protected]>
1 parent 7f53391 commit 7e40627

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/cmd/compile/internal/ssa/func.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,10 @@ func (b *Block) NewValue2I(line int32, op Op, t Type, auxint int64, arg0, arg1 *
284284
func (b *Block) NewValue3(line int32, op Op, t Type, arg0, arg1, arg2 *Value) *Value {
285285
v := b.Func.newValue(op, t, b, line)
286286
v.AuxInt = 0
287-
v.Args = []*Value{arg0, arg1, arg2}
287+
v.Args = v.argstorage[:3]
288+
v.argstorage[0] = arg0
289+
v.argstorage[1] = arg1
290+
v.argstorage[2] = arg2
288291
arg0.Uses++
289292
arg1.Uses++
290293
arg2.Uses++
@@ -295,7 +298,10 @@ func (b *Block) NewValue3(line int32, op Op, t Type, arg0, arg1, arg2 *Value) *V
295298
func (b *Block) NewValue3I(line int32, op Op, t Type, auxint int64, arg0, arg1, arg2 *Value) *Value {
296299
v := b.Func.newValue(op, t, b, line)
297300
v.AuxInt = auxint
298-
v.Args = []*Value{arg0, arg1, arg2}
301+
v.Args = v.argstorage[:3]
302+
v.argstorage[0] = arg0
303+
v.argstorage[1] = arg1
304+
v.argstorage[2] = arg2
299305
arg0.Uses++
300306
arg1.Uses++
301307
arg2.Uses++

src/cmd/compile/internal/ssa/value.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ func (v *Value) resetArgs() {
185185
}
186186
v.argstorage[0] = nil
187187
v.argstorage[1] = nil
188+
v.argstorage[2] = nil
188189
v.Args = v.argstorage[:0]
189190
}
190191

0 commit comments

Comments
 (0)