MCPcopy Index your code
hub / github.com/explodingcamera/tinywasm / convert_module_table

Function convert_module_table

crates/parser/src/conversion.rs:97–106  ·  view source on GitHub ↗
(table: wasmparser::Table<'_>)

Source from the content-addressed store, hash-verified

95}
96
97pub(crate) fn convert_module_table(table: wasmparser::Table<'_>) -> Result<TableType> {
98 let size_initial = table.ty.initial.try_into().map_err(|_| {
99 crate::ParseError::UnsupportedOperator(format!("Table size initial is too large: {}", table.ty.initial))
100 })?;
101
102 let size_max = table.ty.maximum.map(|max| max.try_into()).transpose();
103 let size_max =
104 size_max.map_err(|e| crate::ParseError::UnsupportedOperator(format!("Table size max is too large: {e}")))?;
105 Ok(TableType { element_type: convert_reftype(table.ty.element_type)?, size_initial, size_max })
106}
107
108pub(crate) fn convert_module_globals(
109 globals: wasmparser::SectionLimited<'_, wasmparser::Global<'_>>,

Callers 1

process_payloadMethod · 0.85

Calls 2

convert_reftypeFunction · 0.85
mapMethod · 0.80

Tested by

no test coverage detected