Clone the input binary during wasm_module_validate (#2483)

This commit is contained in:
liang.he
2023-08-21 19:43:28 +08:00
committed by GitHub
parent a2f76cf93c
commit f0632edc37
2 changed files with 23 additions and 4 deletions

View File

@ -65,6 +65,12 @@ int main(int argc, const char* argv[]) {
}
fclose(file);
if (!wasm_module_validate(store, &binary)) {
printf("> Error validate module!\n");
wasm_byte_vec_delete(&binary);
return 1;
}
// Compile.
printf("Compiling module...\n");
own wasm_module_t* module = wasm_module_new(store, &binary);