MCPcopy Create free account
hub / github.com/WebAssembly/wasm-c-api / section

Function section

src/wasm-bin.cc:342–352  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

340};
341
342auto section(const vec<byte_t>& binary, bin::sec_t sec) -> const byte_t* {
343 const byte_t* end = binary.get() + binary.size();
344 const byte_t* pos = binary.get() + 8; // skip header
345 while (pos < end && *pos++ != sec) {
346 auto size = bin::u32(pos);
347 pos += size;
348 }
349 if (pos == end) return nullptr;
350 bin::u32_skip(pos);
351 return pos;
352}
353
354auto section_end(const vec<byte_t>& binary, bin::sec_t sec) -> const byte_t* {
355 const byte_t* end = binary.get() + binary.size();

Callers 7

typesFunction · 0.85
importsFunction · 0.85
funcsFunction · 0.85
globalsFunction · 0.85
tablesFunction · 0.85
memoriesFunction · 0.85
exportsFunction · 0.85

Calls 4

u32Function · 0.85
u32_skipFunction · 0.85
getMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected