1
0
mirror of https://github.com/golang/go synced 2024-07-08 20:29:48 +00:00
Commit Graph

1 Commits

Author SHA1 Message Date
Russ Cox
bed970b3ff cmd/compile: handle integer conversions in static init inliner
Given code like

	func itou(i int) uint { return uint(i) }
	var x = itou(-1)

the static inliner from CL 450136 was rewriting the code to

	var x = uint(-1)

which is not valid Go code. Fix this by converting the
constants appropriately during inlining.

Fixes golang.org/x/image/vector test.

Change-Id: I13448df8504c6a70525b1cdc36e2c947e22cdd33
Reviewed-on: https://go-review.googlesource.com/c/go/+/451376
Auto-Submit: Russ Cox <rsc@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-11-17 13:46:05 +00:00