Commit 916e861f authored by Matthew Dempsky's avatar Matthew Dempsky

cmd/compile: fix importing rewritten f(g()) calls

golang.org/cl/166983 started serializing the Ninit field of OCALL
nodes within function inline bodies (necessary to fix a regression in
building crypto/ecdsa with -gcflags=-l=4), but this means the Ninit
field needs to be typechecked when the imported function body is used.

It's unclear why this wasn't necessary for the crypto/ecdsa
regression.

Fixes #30907.

Change-Id: Id5f0bf3c4d17bbd6d5318913b859093c93a0a20c
Reviewed-on: https://go-review.googlesource.com/c/go/+/168199
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: default avatarRobert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 2c423f06
......@@ -1239,6 +1239,7 @@ func typecheck1(n *Node, top int) (res *Node) {
// call and call like
case OCALL:
typecheckslice(n.Ninit.Slice(), ctxStmt) // imported rewritten f(g()) calls (#30907)
n.Left = typecheck(n.Left, ctxExpr|Etype|ctxCallee)
if n.Left.Diag() {
n.SetDiag(true)
......
// Copyright 2019 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package a
type UUID string
func New() UUID {
return Must(NewRandom())
}
func NewRandom() (UUID, error) {
return "", nil
}
func Must(uuid UUID, err error) UUID {
return uuid
}
// Copyright 2019 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package p
import "./a"
func F() {
a.New()
}
// compiledir
// Copyright 2019 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package ignored
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment