]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.ssa] cmd/compile/internal/ssa: allocate complex zero in the entry block
authorKeith Randall <khr@golang.org>
Fri, 28 Aug 2015 20:52:26 +0000 (13:52 -0700)
committerKeith Randall <khr@golang.org>
Fri, 28 Aug 2015 20:53:56 +0000 (20:53 +0000)
Fixes build.  There may be no current block.

Change-Id: I0da8bab133dc207124556927698e7cd682e64ef5
Reviewed-on: https://go-review.googlesource.com/13989
Reviewed-by: Keith Randall <khr@golang.org>
src/cmd/compile/internal/gc/ssa.go

index a465a6fc1b2edb2f610a08228c9794cbb10aed13..0194a52c2bd34aa3c378afcb499498e397a53946 100644 (file)
@@ -1681,10 +1681,10 @@ func (s *state) zeroVal(t *Type) *ssa.Value {
                switch t.Size() {
                case 8:
                        z := s.constFloat32(Types[TFLOAT32], 0)
-                       return s.newValue2(ssa.OpComplexMake, t, z, z)
+                       return s.entryNewValue2(ssa.OpComplexMake, t, z, z)
                case 16:
                        z := s.constFloat64(Types[TFLOAT64], 0)
-                       return s.newValue2(ssa.OpComplexMake, t, z, z)
+                       return s.entryNewValue2(ssa.OpComplexMake, t, z, z)
                default:
                        s.Fatalf("bad sized complex type %s", t)
                }