summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChangqing Jing <changqing.jing@bmw.com>2024-07-13 00:20:09 +0800
committerGitHub <noreply@github.com>2024-07-12 09:20:09 -0700
commit5d999f051238cb249a3bc80f23f68d2a55c01e96 (patch)
tree71b93e373ac1b0c04171d844d3d9bae40a62d83f /src
parentadc4c9f3c296e3adfe31596b195e5e7f50dc9bd9 (diff)
downloadwabt-5d999f051238cb249a3bc80f23f68d2a55c01e96.tar.gz
wabt-5d999f051238cb249a3bc80f23f68d2a55c01e96.tar.bz2
wabt-5d999f051238cb249a3bc80f23f68d2a55c01e96.zip
Fix parsing of malformed element section in text format (#2439)
Diffstat (limited to 'src')
-rw-r--r--src/wast-parser.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/wast-parser.cc b/src/wast-parser.cc
index 236840ec..f950512f 100644
--- a/src/wast-parser.cc
+++ b/src/wast-parser.cc
@@ -874,7 +874,7 @@ bool WastParser::ParseElemExprOpt(ExprList* out_elem_expr) {
}
EXPECT(Rpar);
} else {
- if (ParseExpr(&exprs) != Result::Ok) {
+ if (!IsExpr(PeekPair()) || ParseExpr(&exprs) != Result::Ok) {
return false;
}
}