-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'br $labelName' cause CompileError 'invalid break depth' #14
Comments
Seems like a bug in libwabt. I hope package https://www.npmjs.com/package/wabt will be updated. If not, i will use webassemblyjs again. |
FYI: There are new versions of wabt.js now, preferrably v1.0.5-nightly.20180920. Note that the API to instantiate it has changed a little (WABT now uses Emscripten's MODULARIZE): // old
var wabt = require("wabt");
// new
var wabt = require("wabt")(); |
@dcodeIO Unfortunately, (module
(type $t0 (func (param i32)))
(type $t1 (func))
(import "env" "log" (func $log (type $t0)))
(func $main (type $t1)
block $B0
block $B1
br 3228196 (; INVALID ;)
i32.const 3
call $log
end
i32.const 2
call $log
end
i32.const 1
call $log)
(start 1)) Probably, it's a bug in original wabt? |
Seems so, yeah, or somehow just in its JS build. Appears that |
For a likely solution to the issue, see: WebAssembly/wabt#915 (comment) |
When writing the code:
After right-clicking the .wat file, 'Save as WebAssembly binary file' and saving a 'program.wasm' file, l use the html:
And loading it by Chrome, it says:
The same code is ok after assembling and downloading .wasm from WebAssembly Explorer.
The text was updated successfully, but these errors were encountered: