wabt
wabt copied to clipboard
wasm-decompile doesn't mark standard exported globals as exported
I've compiled a simple example with Clang 8.0.1:
int f() {
return 42;
}
With latest wabt release (1.0.13), wasm2wat dump for this file is:
(module
(type (;0;) (func))
(func $__wasm_call_ctors (type 0))
(table (;0;) 1 1 funcref)
(memory (;0;) 2)
(global (;0;) (mut i32) (i32.const 66560))
(global (;1;) i32 (i32.const 66560))
(global (;2;) i32 (i32.const 1024))
(export "memory" (memory 0))
(export "__heap_base" (global 1))
(export "__data_end" (global 2)))
while wasm-decompile prints:
export memory memory(initial: 2, max: 0);
global g_a:int = 66560;
global heap_base:int = 66560;
global data_end:int = 1024;
table T_a:funcref(min: 1, max: 1);
function wasm_call_ctors() {
}
Note how globals are not marked as exported, even though they are as shown by wasm2wat.
On a second thought, I wonder if this could be due to latest WABT release (https://github.com/WebAssembly/wabt/releases) being somewhat old - from 17th of January?
I'm not building tools myself, so maybe something changed in between.