summaryrefslogtreecommitdiff
path: root/src/wasm/wasm-binary.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/wasm/wasm-binary.cpp')
-rw-r--r--src/wasm/wasm-binary.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/wasm/wasm-binary.cpp b/src/wasm/wasm-binary.cpp
index 13c28f151..54c904459 100644
--- a/src/wasm/wasm-binary.cpp
+++ b/src/wasm/wasm-binary.cpp
@@ -7111,11 +7111,12 @@ bool WasmBinaryBuilder::maybeVisitArraySet(Expression*& out, uint32_t code) {
}
bool WasmBinaryBuilder::maybeVisitArrayLen(Expression*& out, uint32_t code) {
- if (code != BinaryConsts::ArrayLen) {
+ if (code == BinaryConsts::ArrayLenAnnotated) {
+ // Ignore the type annotation and don't bother validating it.
+ getU32LEB();
+ } else if (code != BinaryConsts::ArrayLen) {
return false;
}
- // Ignore the type annotation and don't bother validating it.
- getU32LEB();
auto* ref = popNonVoidExpression();
out = Builder(wasm).makeArrayLen(ref);
return true;