Helper function to instantiate module.
| 428 | |
| 429 | // Helper function to instantiate module. |
| 430 | WasmEdge_ModuleInstanceContext * |
| 431 | instantiateModule(const WasmEdge_ConfigureContext *Conf, |
| 432 | WasmEdge_StoreContext *Store, |
| 433 | const WasmEdge_ASTModuleContext *Mod) { |
| 434 | WasmEdge_ExecutorContext *ExecCxt = WasmEdge_ExecutorCreate(Conf, nullptr); |
| 435 | WasmEdge_ModuleInstanceContext *ResMod = nullptr; |
| 436 | WasmEdge_ExecutorInstantiate(ExecCxt, &ResMod, Store, Mod); |
| 437 | WasmEdge_ExecutorDelete(ExecCxt); |
| 438 | return ResMod; |
| 439 | } |
| 440 | |
| 441 | // Helper function to read file into a buffer. |
| 442 | bool readToVector(const char *Path, std::vector<uint8_t> &Buf) { |
no test coverage detected