mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile/internal/devirtualize: fix typos
Change-Id: I4f5a89f452a252018072d067da4cdb9a6cb0f4fe
GitHub-Last-Rev: 7eb108d387
GitHub-Pull-Request: golang/go#76396
Reviewed-on: https://go-review.googlesource.com/c/go/+/722860
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Robert Griesemer <gri@google.com>
This commit is contained in:
parent
4b0e3cc1d6
commit
b9d86baae3
1 changed files with 5 additions and 5 deletions
|
|
@ -131,7 +131,7 @@ func StaticCall(s *State, call *ir.CallExpr) {
|
|||
// type assertion that we make here would also have failed, but with a different
|
||||
// panic "pkg.Iface is nil, not *pkg.Impl", where previously we would get a nil panic.
|
||||
// We fix this, by introducing an additional nilcheck on the itab.
|
||||
// Calling a method on an nil interface (in most cases) is a bug in a program, so it is fine
|
||||
// Calling a method on a nil interface (in most cases) is a bug in a program, so it is fine
|
||||
// to devirtualize and further (possibly) inline them, even though we would never reach
|
||||
// the called function.
|
||||
dt.UseNilPanic = true
|
||||
|
|
@ -197,7 +197,7 @@ var noType types.Type
|
|||
|
||||
// concreteType1 analyzes the node n and returns its concrete type if it is statically known.
|
||||
// Otherwise, it returns a nil Type, indicating that a concrete type was not determined.
|
||||
// When n is known to be statically nil or a self-assignment is detected, in returns a sentinel [noType] type instead.
|
||||
// When n is known to be statically nil or a self-assignment is detected, it returns a sentinel [noType] type instead.
|
||||
func concreteType1(s *State, n ir.Node, seen map[*ir.Name]struct{}) (outT *types.Type) {
|
||||
nn := n // for debug messages
|
||||
|
||||
|
|
@ -310,7 +310,7 @@ func concreteType1(s *State, n ir.Node, seen map[*ir.Name]struct{}) (outT *types
|
|||
// assignment can be one of:
|
||||
// - nil - assignment from an interface type.
|
||||
// - *types.Type - assignment from a concrete type (non-interface).
|
||||
// - ir.Node - assignment from a ir.Node.
|
||||
// - ir.Node - assignment from an ir.Node.
|
||||
//
|
||||
// In most cases assignment should be an [ir.Node], but in cases where we
|
||||
// do not follow the data-flow, we return either a concrete type (*types.Type) or a nil.
|
||||
|
|
@ -560,8 +560,8 @@ func (s *State) analyze(nodes ir.Nodes) {
|
|||
assign(n.Key, nil)
|
||||
assign(n.Value, nil)
|
||||
} else {
|
||||
// We will not reach here in case of an range-over-func, as it is
|
||||
// rewrtten to function calls in the noder package.
|
||||
// We will not reach here in case of a range-over-func, as it is
|
||||
// rewritten to function calls in the noder package.
|
||||
base.FatalfAt(n.Pos(), "range over unexpected type %v", n.X.Type())
|
||||
}
|
||||
case ir.OSWITCH:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue