1
0
mirror of https://github.com/golang/go synced 2024-11-07 03:46:17 -07:00

cmd/compile: fix linux-amd64-noopt builder

CL 312214 added unsafe.{Add,Slice}, which may appears in expression that
evaluating requires function calls. "mayCall" does not handle that
case, causing linux-amd64-noopt builder failed.

Fixes #45917

Change-Id: I900aefb702122480be621355def3d2c20eadbe70
Reviewed-on: https://go-review.googlesource.com/c/go/+/316170
Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
Cuong Manh Le 2021-05-03 14:10:23 +07:00
parent 90ec257735
commit 7f9febd4a1

View File

@ -308,7 +308,8 @@ func mayCall(n ir.Node) bool {
default:
base.FatalfAt(n.Pos(), "mayCall %+v", n)
case ir.OCALLFUNC, ir.OCALLMETH, ir.OCALLINTER:
case ir.OCALLFUNC, ir.OCALLMETH, ir.OCALLINTER,
ir.OUNSAFEADD, ir.OUNSAFESLICE:
return true
case ir.OINDEX, ir.OSLICE, ir.OSLICEARR, ir.OSLICE3, ir.OSLICE3ARR, ir.OSLICESTR,