aboutsummaryrefslogtreecommitdiffhomepage
path: root/compiler/symbol.go
diff options
context:
space:
mode:
authorAyke van Laethem <[email protected]>2023-03-27 19:01:34 +0200
committerRon Evans <[email protected]>2023-03-28 09:31:09 +0200
commit17bc0d6663776259494ceb50e83ea9db84328053 (patch)
tree5cf3d8f5f9d3b4058793d36603d545b8c3b7940f /compiler/symbol.go
parent31043628d8349d52e81d3fc4deaf556c299299ae (diff)
downloadtinygo-17bc0d6663776259494ceb50e83ea9db84328053.tar.gz
tinygo-17bc0d6663776259494ceb50e83ea9db84328053.zip
compiler: only support //go:wasmimport on declared functions
Don't support this pragma on defined functions. It is only meant for importing, not for exporting.
Diffstat (limited to 'compiler/symbol.go')
-rw-r--r--compiler/symbol.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/symbol.go b/compiler/symbol.go
index feff10ba0..6e66c2bfd 100644
--- a/compiler/symbol.go
+++ b/compiler/symbol.go
@@ -291,7 +291,7 @@ func (info *functionInfo) parsePragmas(f *ssa.Function) {
case "//go:wasmimport":
// Import a WebAssembly function, for example a WASI function.
// For details, see: https://github.com/golang/go/issues/38248
- if len(parts) != 3 {
+ if len(parts) != 3 || len(f.Blocks) != 0 {
continue
}
info.exported = true