mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Internal change.
PiperOrigin-RevId: 721019932
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user