aboutsummaryrefslogtreecommitdiffstats
path: root/test/autowasm.c
diff options
context:
space:
mode:
authorbloodstalker <thabogre@gmail.com>2019-08-13 16:13:11 +0000
committerbloodstalker <thabogre@gmail.com>2019-08-13 16:13:11 +0000
commita46c23d01d20eef63194ce6f8745afb130e9ba20 (patch)
tree30d9fe4b38a88c5b6bdbe96cf84a43b8d4d1f7d0 /test/autowasm.c
parentupdate (diff)
downloadfaultreiber-a46c23d01d20eef63194ce6f8745afb130e9ba20.tar.gz
faultreiber-a46c23d01d20eef63194ce6f8745afb130e9ba20.zip
added ltg as submodule to see why --lua switch breaks
Diffstat (limited to 'test/autowasm.c')
-rw-r--r--test/autowasm.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/autowasm.c b/test/autowasm.c
index 67ecfd1..b7b92b2 100644
--- a/test/autowasm.c
+++ b/test/autowasm.c
@@ -10,6 +10,8 @@
//#include "./read.h"
#include "./aggregate.h"
+#define WASM
+
#pragma weak main
int main (int argc, char** argv) {
@@ -31,7 +33,9 @@ int main (int argc, char** argv) {
}
}
int wasm = open("./read.wasm", O_RDONLY);
- wasm_lib_ret_t* lib_ret = read_aggr_wasm(wasm);
+ lua_State* ls = luaL_newstate();
+ reg_tablegen_tables_wasm(ls);
+ wasm_lib_ret_t* lib_ret = read_aggr_wasm(wasm, ls);
printf("finished reading\n");
#if 1
@@ -174,6 +178,7 @@ int main (int argc, char** argv) {
}
#endif
+#if 0
printf("sizeof magic:%d\n", sizeof(magic_number));
printf("sizeof version:%d\n", sizeof(version));
printf("current void count:%d\n", lib_ret->current_void_count);
@@ -185,6 +190,7 @@ int main (int argc, char** argv) {
//free(lib_ret->void_train[2]);
//free(lib_ret->void_train[1]);
//free(lib_ret->void_train[0]);
+#endif
#if 0
for (int i = lib_ret->current_void_count - 1; i >= 0; --i) {
printf("%d:0x%x ", i, lib_ret->void_train[i]);
@@ -193,7 +199,9 @@ int main (int argc, char** argv) {
}
#endif
//free(lib_ret->void_train);
+#if 0
free(lib_ret->obj);
free(lib_ret);
+#endif
return 0;
}