From 08b4f01e716b4bfc079861f5b3091fbcc943d67a Mon Sep 17 00:00:00 2001 From: bloodstalker Date: Fri, 5 Oct 2018 00:20:16 +0330 Subject: more bug fixes --- bruiser/autogen/wasm/wasm.xml | 6 +++--- bruiser/lua-scripts/wasmtest.lua | 17 +++++++++-------- 2 files changed, 12 insertions(+), 11 deletions(-) (limited to 'bruiser') diff --git a/bruiser/autogen/wasm/wasm.xml b/bruiser/autogen/wasm/wasm.xml index 81299a0..db68ed7 100644 --- a/bruiser/autogen/wasm/wasm.xml +++ b/bruiser/autogen/wasm/wasm.xml @@ -105,10 +105,10 @@ - + - + @@ -156,7 +156,7 @@ - + diff --git a/bruiser/lua-scripts/wasmtest.lua b/bruiser/lua-scripts/wasmtest.lua index 50b753a..f005448 100644 --- a/bruiser/lua-scripts/wasmtest.lua +++ b/bruiser/lua-scripts/wasmtest.lua @@ -40,7 +40,7 @@ function libwasm.dump_import_section(a) io.write("field len:"..v:field_len().."\t") io.write("field str:"..v:field_str().."\t") io.write("kind:"..v:kind().."\t") - io.write("type:"..v:type().."\n") + io.write("kind:"..type(v:type()).."\t") end else print(colors("%{red}".."section doesnt exist.")) @@ -198,10 +198,10 @@ function libwasm.dump_code_section(a) io.write(colors("\n%{cyan}".."entry:\n")) io.write("body_size:"..v:body_size().."\t") io.write("local_count:"..v:local_count().."\t") - io.write(tostring(v:locals()).."\t") + io.write(tostring(v:locals()).."\n") for i, j in pairs(v:locals()) do io.write("locals count:"..j:count().."\t") - io.write("locals type:"..j:type().."\t") + io.write("locals type:"..j:type().."\n") end io.write("function body:\n") for i,j in pairs(v:code()) do @@ -247,8 +247,8 @@ end function libwasm.dump_all(wasm_path) local a = getwasmobj(wasm_path) - libwasm.dump_import_section(a) libwasm.dump_type_section(a) + libwasm.dump_import_section(a) libwasm.dump_function_section(a) libwasm.dump_table_section(a) libwasm.dump_memory_section(a) @@ -272,8 +272,8 @@ function libwasm.demo_getters(wasm_path) for k, v in pairs(a) do print(k, v, type(k), type(v)) end - libwasm.dump_import_section(a) libwasm.dump_type_section(a) + libwasm.dump_import_section(a) libwasm.dump_function_section(a) libwasm.dump_table_section(a) libwasm.dump_memory_section(a) @@ -1010,7 +1010,7 @@ function libwasm.demo_setters(wasm_path) body1:set_code({12,13,11}) body2:set_code({12,13,11}) body3:set_code({12,13,11}) - --body1:set_locals(l_entry1) + body1:set_locals(l_entry1) --body2:set_locals(l_entry2) --body3:set_locals(l_entry3) local new_bodies = {} @@ -1018,7 +1018,7 @@ function libwasm.demo_setters(wasm_path) new_bodies[2] = body2 new_bodies[3] = body3 - a["code_section"]:set_count(pre) + a["code_section"]:set_count(5) pre = a["code_section"]:bodies() a["code_section"]:set_count(3) a["code_section"]:set_bodies(new_bodies) @@ -1132,7 +1132,8 @@ end --libwasm.dev("/home/bloodstalker/devi/hell2/bruiser/autogen/wasm/ft/test.wasm") --libwasm.demo_getters("/home/bloodstalker/devi/hell2/bruiser/autogen/wasm/ft/test.wasm") -libwasm.demo_setters("/home/bloodstalker/devi/hell2/bruiser/autogen/wasm/ft/test.wasm") +libwasm.demo_getters("/home/bloodstalker/devi/hell2/bruiser/autogen/wasm/ft/aggregate.wasm") +--libwasm.demo_setters("/home/bloodstalker/devi/hell2/bruiser/autogen/wasm/ft/test.wasm") --libwasm.dump_all("/home/bloodstalker/devi/hell2/bruiser/autogen/wasm/ft/test.wasm") return libwasm -- cgit v1.2.3