summaryrefslogtreecommitdiff
path: root/src/wast-parser.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/wast-parser.cc')
-rw-r--r--src/wast-parser.cc14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/wast-parser.cc b/src/wast-parser.cc
index 517b70bc..ca21584f 100644
--- a/src/wast-parser.cc
+++ b/src/wast-parser.cc
@@ -932,9 +932,17 @@ Result WastParser::ParseElemModuleField(Module* module) {
EXPECT(Lpar);
Location loc = GetLocation();
EXPECT(Elem);
- std::string name;
- ParseBindVarOpt(&name);
- auto field = MakeUnique<ElemSegmentModuleField>(loc, name);
+ std::string segment_name;
+ ParseBindVarOpt(&segment_name);
+ // With MVP text format the name here was intended to refer to the table
+ // that the elem segment was part of, but we never did anything with this name
+ // since there was only one table anyway.
+ // With bulk-memory enabled this introduces a new name for the particualr
+ // elem segment.
+ if (!options_->features.bulk_memory_enabled()) {
+ segment_name = "";
+ }
+ auto field = MakeUnique<ElemSegmentModuleField>(loc, segment_name);
if (ParseRefTypeOpt(&field->elem_segment.elem_type)) {
field->elem_segment.passive = true;