Skip to content

Commit

Permalink
Internal change.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 721019932
  • Loading branch information
gvisor-bot committed Jan 29, 2025
1 parent c191ceb commit 8bdf76c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tools/checkconst/checkconst.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion tools/checklocks/analysis.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion tools/checklocks/checklocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion tools/checklocks/facts.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand Down

0 comments on commit 8bdf76c

Please sign in to comment.