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.
This commit is contained in:
Ayke van Laethem
2023-03-27 19:01:34 +02:00
committed by Ron Evans
parent 31043628d8
commit 17bc0d6663
3 changed files with 17 additions and 1 deletions
+7
View File
@@ -59,6 +59,13 @@ func functionInSection() {
func exportedFunctionInSection() {
}
//go:wasmimport modulename import1
func declaredImport()
//go:wasmimport modulename import2
func definedImport() {
}
// This function should not: it's only a declaration and not a definition.
//
//go:section .special_function_section