Commit 124eccd5 authored by Josh Bleecher Snyder's avatar Josh Bleecher Snyder

cmd/compile: improve fncall docs

Comment changes only.

Change-Id: I3f9c1c38ae6b4989f02b62fff09265e4bcb934f7
Reviewed-on: https://go-review.googlesource.com/114519
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
parent e52c1c02
......@@ -1836,10 +1836,7 @@ func ascompatee(op Op, nl, nr []*Node, init *Nodes) []*Node {
return nn
}
// l is an lv and rt is the type of an rv
// return 1 if this implies a function call
// evaluating the lv or a function call
// in the conversion of the types
// fncall reports whether assigning an rvalue of type rt to an lvalue l might involve a function call.
func fncall(l *Node, rt *types.Type) bool {
if l.HasCall() || l.Op == OINDEXMAP {
return true
......@@ -1847,6 +1844,7 @@ func fncall(l *Node, rt *types.Type) bool {
if eqtype(l.Type, rt) {
return false
}
// There might be a conversion required, which might involve a runtime call.
return true
}
......@@ -1865,9 +1863,8 @@ func ascompatet(nl Nodes, nr *types.Type) []*Node {
}
r := nr.Field(i)
// any lv that causes a fn call must be
// deferred until all the return arguments
// have been pulled from the output arguments
// Any assignment to an lvalue that might cause a function call must be
// deferred until all the returned values have been read.
if fncall(l, r.Type) {
tmp := temp(r.Type)
tmp = typecheck(tmp, Erv)
......
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