MCPcopy Create free account
hub / github.com/WasmEdge/WasmEdge / loadStart

Method loadStart

lib/loader/ast/component/component_start.cpp:9–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7namespace Loader {
8
9Expect<void> Loader::loadStart(AST::Component::Start &S) {
10 auto ReportError = [this](auto E) {
11 return logLoadError(E, FMgr.getLastOffset(), ASTNodeAttr::Comp_Start);
12 };
13 // start ::= f:<funcidx> arg*:vec(<valueidx>) r:<u32>
14 // => (start f (value arg)* (result (value))ʳ)
15
16 EXPECTED_TRY(S.getFunctionIndex(), FMgr.readU32().map_error(ReportError));
17 auto F = [this, ReportError](uint32_t &V) -> Expect<void> {
18 EXPECTED_TRY(V, FMgr.readU32().map_error(ReportError));
19 return {};
20 };
21 EXPECTED_TRY(loadVec<AST::Component::Start>(S.getArguments(), F));
22 EXPECTED_TRY(S.getResult(), FMgr.readU32().map_error(ReportError));
23 return {};
24}
25
26} // namespace Loader
27} // namespace WasmEdge

Callers

nothing calls this directly

Calls 6

getLastOffsetMethod · 0.80
getFunctionIndexMethod · 0.80
readU32Method · 0.80
getArgumentsMethod · 0.80
EXPECTED_TRYFunction · 0.70
getResultMethod · 0.45

Tested by

no test coverage detected