MCPcopy Create free account
hub / github.com/WasmEdge/WasmEdge / WasmEdge_Result WasmEdge_VMRunWasmFromASTModule

Function WasmEdge_Result WasmEdge_VMRunWasmFromASTModule

lib/api/wasmedge.cpp:3310–3328  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3308}
3309
3310WASMEDGE_CAPI_EXPORT WasmEdge_Result WasmEdge_VMRunWasmFromASTModule(
3311 WasmEdge_VMContext *Cxt, const WasmEdge_ASTModuleContext *ASTCxt,
3312 const WasmEdge_String FuncName, const WasmEdge_Value *Params,
3313 const uint32_t ParamLen, WasmEdge_Value *Returns,
3314 const uint32_t ReturnLen) noexcept {
3315 try {
3316 auto ParamPair = genParamPair(Params, ParamLen);
3317 return wrap(
3318 [&]() {
3319 return Cxt->VM.runWasmFile(*fromASTModCxt(ASTCxt),
3320 genStrView(FuncName), ParamPair.first,
3321 ParamPair.second);
3322 },
3323 [&](auto &&Res) { fillWasmEdge_ValueArr(*Res, Returns, ReturnLen); },
3324 Cxt, ASTCxt);
3325 } catch (...) {
3326 return handleCAPIError();
3327 }
3328}
3329
3330WASMEDGE_CAPI_EXPORT WasmEdge_Async *WasmEdge_VMAsyncRunWasmFromFile(
3331 WasmEdge_VMContext *Cxt, const char *Path, const WasmEdge_String FuncName,

Callers

nothing calls this directly

Calls 6

genParamPairFunction · 0.85
wrapFunction · 0.85
genStrViewFunction · 0.85
fillWasmEdge_ValueArrFunction · 0.85
handleCAPIErrorFunction · 0.85
runWasmFileMethod · 0.80

Tested by

no test coverage detected