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.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/wast-parser.cc b/src/wast-parser.cc
index 635b1b3a..a51cb2a5 100644
--- a/src/wast-parser.cc
+++ b/src/wast-parser.cc
@@ -982,6 +982,10 @@ Result WastParser::ParseElemModuleField(Module* module) {
}
}
+ if (!ParseOffsetExprOpt(&field->elem_segment.offset)) {
+ field->elem_segment.flags |= SegPassive;
+ }
+
if (ParseRefTypeOpt(&field->elem_segment.elem_type)) {
field->elem_segment.flags |= (SegPassive | SegUseElemExprs);
// Parse a potentially empty sequence of ElemExprs.
@@ -1001,9 +1005,6 @@ Result WastParser::ParseElemModuleField(Module* module) {
}
} else {
field->elem_segment.elem_type = Type::Funcref;
- if (!ParseOffsetExprOpt(&field->elem_segment.offset)) {
- field->elem_segment.flags |= SegPassive;
- }
if (PeekMatch(TokenType::Func)) {
EXPECT(Func);
}