summaryrefslogtreecommitdiff
path: root/src/wasm/wasm-ir-builder.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/wasm/wasm-ir-builder.cpp')
-rw-r--r--src/wasm/wasm-ir-builder.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/wasm/wasm-ir-builder.cpp b/src/wasm/wasm-ir-builder.cpp
index 99462e9a8..7b88d345f 100644
--- a/src/wasm/wasm-ir-builder.cpp
+++ b/src/wasm/wasm-ir-builder.cpp
@@ -175,7 +175,9 @@ Result<Expression*> IRBuilder::pop(size_t size) {
CHECK_ERR(packageHoistedValue(*hoisted, size));
auto* ret = scope.exprStack.back();
- if (ret->type.size() == size) {
+ // If the top value has the correct size, we can pop it and be done.
+ // Unreachable values satisfy any size.
+ if (ret->type.size() == size || ret->type == Type::unreachable) {
scope.exprStack.pop_back();
return ret;
}