Internal change.

PiperOrigin-RevId: 721019932
This commit is contained in:
gVisor bot
2025-01-29 10:13:52 -08:00
parent c191ceb4b8
commit 8bdf76c5ca
4 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -84,7 +84,7 @@ func (c *Constants) walkObject(pass *analysis.Pass, parents []string, obj types.
if typ == nil || typ.Underlying() == nil {
break
}
if _, ok := typ.(*types.TypeParam); ok {
if _, ok := types.Unalias(typ).(*types.TypeParam); ok {
break
}
// Add basic information.
+1 -1
View File
@@ -56,7 +56,7 @@ func (pc *passContext) typeAlignment(pkg *types.Package, obj types.Object) atomi
}
case *types.Array:
// Export direct alignment requirements.
if named, ok := x.Elem().(*types.Named); ok && !hasTypeParams(named) {
if named, ok := types.Unalias(x.Elem()).(*types.Named); ok && !hasTypeParams(named) {
requiredOffset = pc.typeAlignment(pkg, named.Obj())
}
default:
+1 -1
View File
@@ -165,7 +165,7 @@ func run(pass *analysis.Pass) (any, error) {
// Check all alignments.
pc.forAllTypes(func(ts *ast.TypeSpec) {
typ, ok := pass.TypesInfo.TypeOf(ts.Name).(*types.Named)
typ, ok := types.Unalias(pass.TypesInfo.TypeOf(ts.Name)).(*types.Named)
if !ok {
return
}
+1 -1
View File
@@ -678,7 +678,7 @@ func (pc *passContext) structLockGuardFacts(structType *types.Struct, ss *ast.St
// See above, for anonymous structure fields.
if ss, ok := field.Type.(*ast.StructType); ok {
if st, ok := fieldObj.Type().(*types.Struct); ok {
if st, ok := types.Unalias(fieldObj.Type()).(*types.Struct); ok {
pc.structLockGuardFacts(st, ss)
}
}