diff options
Diffstat (limited to 'src/interp/binary-reader-interp.cc')
-rw-r--r-- | src/interp/binary-reader-interp.cc | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/interp/binary-reader-interp.cc b/src/interp/binary-reader-interp.cc index 3f270abf..5312e78b 100644 --- a/src/interp/binary-reader-interp.cc +++ b/src/interp/binary-reader-interp.cc @@ -1130,11 +1130,6 @@ wabt::Result BinaryReaderInterp::OnElemSegmentElemExprCount(Index index, if (segment_flags_ & SegPassive) { elem_segment_info_ = nullptr; } else { - // An active segment still is present in the segment index space, but - // cannot be used with `table.init` (it's as if it has already been - // dropped). - elem_segment_->dropped = true; - assert(segment_table_index_ != kInvalidIndex); Table* table = GetTableByModuleIndex(segment_table_index_); module_->active_elem_segments_.emplace_back(table, table_offset_); @@ -1146,7 +1141,11 @@ wabt::Result BinaryReaderInterp::OnElemSegmentElemExprCount(Index index, wabt::Result BinaryReaderInterp::OnElemSegmentElemExpr_RefNull( Index segment_index) { assert(segment_flags_ & SegUseElemExprs); - elem_segment_->elems.push_back({RefType::Null, kInvalidIndex}); + if (segment_flags_ & SegPassive) { + elem_segment_->elems.push_back({RefType::Null, kInvalidIndex}); + } else { + elem_segment_info_->src.push_back({RefType::Null, kInvalidIndex}); + } return wabt::Result::Ok; } @@ -1207,11 +1206,6 @@ wabt::Result BinaryReaderInterp::OnDataSegmentData(Index index, return wabt::Result::Error; } - // An active segment still is present in the segment index space, but - // cannot be used with `memory.init` (it's as if it has already been - // dropped). - segment->dropped = true; - assert(module_->memory_index != kInvalidIndex); Memory* memory = env_->GetMemory(module_->memory_index); Address address = init_expr_value_.value.i32; |