mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-12 22:41:27 +00:00
Initial instance methods and field layout; More cleanup
This commit is contained in:
@ -9,8 +9,9 @@ var func = mod.addFunction("test", funcType, [],
|
||||
)
|
||||
])
|
||||
);
|
||||
mod.addExport("test", func);
|
||||
mod.addFunctionExport("test", "test", func);
|
||||
|
||||
console.log(mod.emitText());
|
||||
if (mod.validate())
|
||||
console.log("-> validates");
|
||||
mod.emitBinary(); // -> Assertion failed: mappedGlobals.count(name), at: binaryen/src/wasm/wasm-binary.cpp,355,getGlobalIndex at Error
|
||||
|
19
tests/binaryen/get_local-missing.js
Normal file
19
tests/binaryen/get_local-missing.js
Normal file
@ -0,0 +1,19 @@
|
||||
var binaryen = require("binaryen");
|
||||
|
||||
var mod = new binaryen.Module();
|
||||
var funcType = mod.addFunctionType("v", binaryen.void, []);
|
||||
var func = mod.addFunction("test", funcType, [],
|
||||
mod.block("", [
|
||||
mod.drop(
|
||||
mod.getLocal(0, binaryen.i32)
|
||||
)
|
||||
])
|
||||
);
|
||||
mod.addFunctionExport("test", "test", func);
|
||||
|
||||
console.log(mod.emitText());
|
||||
if (mod.validate()) {
|
||||
console.log("-> validates");
|
||||
var binary = mod.emitBinary();
|
||||
new WebAssembly.Module(binary); // CompileError: WebAssembly.Module(): Compiling wasm function #0:test failed: invalid local index: 0 @+34
|
||||
}
|
Reference in New Issue
Block a user