maxpro:gowasm maxim$ cat wasm.go
package main
func main() {
}
maxpro:gowasm maxim$ GOOS=js GOARCH=wasm go build -o main.wasm
maxpro:gowasm maxim$ wasm-validate ./main.wasm
maxpro:gowasm maxim$
panic: Error: inconsistent stack pattern: pt = false, lpt = false, ls = 2, sd = 0
---GO TRACEBACK---
goroutine 1 [running]:
runtime/debug.Stack(0x4195060, 0xc000b13a30, 0x4240480)
/usr/local/go/src/runtime/debug/stack.go:24 +0x9d
github.com/perlin-network/life/utils.CatchPanic(0xc000195a40)
/Users/maxim/temporal/life/utils/catch.go:11 +0x72
panic(0x4195060, 0xc000b13a30)
/usr/local/go/src/runtime/panic.go:679 +0x1b2
github.com/perlin-network/life/compiler.(*SSAFunctionCompiler).Compile(0xc000195988, 0xc00000ad00, 0x13, 0x20)
/Users/maxim/temporal/life/compiler/ssa.go:339 +0xcb95
github.com/perlin-network/life/compiler.(*Module).CompileForInterpreter(0xc00000e040, 0x0, 0x0, 0xc00016a000, 0x6c5, 0x6cc, 0x0, 0x0)
/Users/maxim/temporal/life/compiler/module.go:264 +0xa5f
github.com/perlin-network/life/exec.NewVirtualMachine(0xc000162000, 0x228953, 0x228b53, 0x0, 0x0, 0x0, 0x0, 0x0, 0x80, 0x10000, ...)
/Users/maxim/temporal/life/exec/vm.go:437 +0xd0
main.main()
/Users/maxim/temporal/life/main.go:82 +0x300
goroutine 1 [running]:
main.main()
/Users/maxim/temporal/life/main.go:89 +0xbe1
Process finished with exit code 2
I do understand that really executing Go program would require polyfilling functions that Go needs, but at least it would be nice to be able to compile and run it until it fails with the first such function.
I'm trying to execute the simple Go program compiled to wasm:
When trying to execute it using life/main.go I'm getting the following panic:
I do understand that really executing Go program would require polyfilling functions that Go needs, but at least it would be nice to be able to compile and run it until it fails with the first such function.