]> Cypherpunks.ru repositories - gostls13.git/blobdiff - src/cmd/compile/internal/gc/reflect.go
[dev.boringcrypto] all: merge master into dev.boringcrypto
[gostls13.git] / src / cmd / compile / internal / gc / reflect.go
index 5c0d9d1afaeae23b6fbff9469640a29c33e51a52..39293917c78cd477dc664af836e3cd11e2229ad9 100644 (file)
@@ -330,7 +330,6 @@ func deferstruct(stksize int64) *types.Type {
                return f
        }
        argtype := types.NewArray(types.Types[TUINT8], stksize)
-       argtype.SetNoalg(true)
        argtype.Width = stksize
        argtype.Align = 1
        // These fields must match the ones in runtime/runtime2.go:_defer and
@@ -1687,7 +1686,17 @@ func (a typesByString) Less(i, j int) bool {
        // they refer to byte or uint8, such as **byte vs **uint8,
        // the types' ShortStrings can be identical.
        // To preserve deterministic sort ordering, sort these by String().
-       return a[i].regular < a[j].regular
+       if a[i].regular != a[j].regular {
+               return a[i].regular < a[j].regular
+       }
+       // Identical anonymous interfaces defined in different locations
+       // will be equal for the above checks, but different in DWARF output.
+       // Sort by source position to ensure deterministic order.
+       // See issues 27013 and 30202.
+       if a[i].t.Etype == types.TINTER && a[i].t.Methods().Len() > 0 {
+               return a[i].t.Methods().Index(0).Pos.Before(a[j].t.Methods().Index(0).Pos)
+       }
+       return false
 }
 func (a typesByString) Swap(i, j int) { a[i], a[j] = a[j], a[i] }