summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/wasm-s-parser.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/wasm-s-parser.h b/src/wasm-s-parser.h
index 3d55a1bc1..531341b01 100644
--- a/src/wasm-s-parser.h
+++ b/src/wasm-s-parser.h
@@ -946,7 +946,9 @@ private:
for (; i < s.size() && i < stopAt; i++) {
ret->list.push_back(parseExpression(s[i]));
}
- ret->type = ret->list.back()->type;
+ if (ret->list.size() > 0) {
+ ret->type = ret->list.back()->type;
+ }
return ret;
}