mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: allow more types for wasmimport/wasmexport parameters and results
As proposed on #66984, this CL allows more types to be used as wasmimport/wasmexport function parameters and results. Specifically, bool, string, and uintptr are now allowed, and also pointer types that point to allowed element types. Allowed element types includes sized integer and floating point types (including small integer types like uint8 which are not directly allowed as a parameter type), bool, array whose element type is allowed, and struct whose fields are allowed element type and also include a struct.HostLayout field. For #66984. Change-Id: Ie5452a1eda21c089780dfb4d4246de6008655c84 Reviewed-on: https://go-review.googlesource.com/c/go/+/626615 Reviewed-by: David Chase <drchase@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
parent
583d750fa1
commit
5a9aeef9d5
5 changed files with 127 additions and 31 deletions
|
|
@ -762,6 +762,10 @@ const (
|
|||
WasmF32
|
||||
WasmF64
|
||||
WasmPtr
|
||||
|
||||
// bool is not really a wasm type, but we allow it on wasmimport/wasmexport
|
||||
// function parameters/results. 32-bit on Wasm side, 8-bit on Go side.
|
||||
WasmBool
|
||||
)
|
||||
|
||||
type InlMark struct {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue