summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/s2wasm.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/s2wasm.h b/src/s2wasm.h
index 5b7cd1fa4..383ff1e36 100644
--- a/src/s2wasm.h
+++ b/src/s2wasm.h
@@ -745,7 +745,11 @@ class S2WasmBuilder {
};
auto setOutput = [&](Expression* curr, Name assign) {
if (assign.isNull() || assign.str[0] == 'd') { // drop
- addToBlock(builder.makeDrop(curr));
+ auto* add = curr;
+ if (isConcreteWasmType(curr->type)) {
+ add = builder.makeDrop(curr);
+ }
+ addToBlock(add);
} else if (assign.str[0] == 'p') { // push
push(curr);
} else { // set to a local