var effect liveEffect
// Read is a read, obviously.
//
- // Addr is a read also, as any subseqent holder of the pointer must be able
+ // Addr is a read also, as any subsequent holder of the pointer must be able
// to see all the values (including initialization) written so far.
// This also prevents a variable from "coming back from the dead" and presenting
// stale pointers to the garbage collector. See issue 28445.
return lv.livenessMap
}
+// TODO(cuonglm,mdempsky): Revisit after #24416 is fixed.
func isfat(t *types.Type) bool {
if t != nil {
switch t.Etype {
- case TSTRUCT, TARRAY, TSLICE, TSTRING,
+ case TSLICE, TSTRING,
TINTER: // maybe remove later
return true
+ case TARRAY:
+ // Array of 1 element, check if element is fat
+ if t.NumElem() == 1 {
+ return isfat(t.Elem())
+ }
+ return true
+ case TSTRUCT:
+ // Struct with 1 field, check if field is fat
+ if t.NumFields() == 1 {
+ return isfat(t.Field(0).Type)
+ }
+ return true
}
}