MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / sections

Method sections

tools/webassembly.py:278–291  ·  view source on GitHub ↗

Lazily yield sections from the wasm file.

(self)

Source from the content-addressed store, hash-verified

276 self.buf.seek(count, os.SEEK_CUR)
277
278 def sections(self):
279 """Lazily yield sections from the wasm file."""
280 offset = HEADER_SIZE
281 while offset < self.size:
282 self.seek(offset)
283 section_type = SecType(self.read_byte())
284 section_size = self.read_uleb()
285 section_offset = self.buf.tell()
286 name = None
287 if section_type == SecType.CUSTOM:
288 name = self.read_string()
289
290 yield Section(section_type, section_size, section_offset, name)
291 offset = section_offset + section_size
292
293 @memoize
294 def get_types(self):

Callers 8

parse_dylink_sectionMethod · 0.95
get_sectionMethod · 0.95
get_custom_sectionMethod · 0.95
read_name_sectionFunction · 0.80
is_wasm_dylibFunction · 0.80
test_separate_dwarfMethod · 0.80

Calls 6

seekMethod · 0.95
read_byteMethod · 0.95
read_ulebMethod · 0.95
read_stringMethod · 0.95
SecTypeClass · 0.85
tellMethod · 0.45

Tested by 2

test_separate_dwarfMethod · 0.64