MCPcopy Create free account
hub / github.com/WebAssembly/wabt / BeginElemSegment

Method BeginElemSegment

src/interp/binary-reader-interp.cc:770–787  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

768}
769
770Result BinaryReaderInterp::BeginElemSegment(Index index,
771 Index table_index,
772 uint8_t flags) {
773 auto mode = ToSegmentMode(flags);
774 CHECK_RESULT(validator_.OnElemSegment(GetLocation(),
775 Var(table_index, GetLocation()), mode));
776
777 ValueType offset_type = ValueType::I32;
778 if (table_index < table_types_.size() &&
779 table_types_[table_index].limits.is_64) {
780 offset_type = ValueType::I64;
781 }
782 FuncDesc init_func{
783 FuncType{{}, {offset_type}}, {}, Istream::kInvalidOffset, {}};
784 ElemDesc desc{{}, ValueType::Void, mode, table_index, init_func};
785 module_.elems.push_back(desc);
786 return Result::Ok;
787}
788
789Result BinaryReaderInterp::BeginElemSegmentInitExpr(Index index) {
790 ElemDesc& elem = module_.elems.back();

Callers

nothing calls this directly

Calls 5

ToSegmentModeFunction · 0.85
OnElemSegmentMethod · 0.80
VarClass · 0.50
sizeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected