summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/passes/Print.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp
index 51e78c8a7..549aa661d 100644
--- a/src/passes/Print.cpp
+++ b/src/passes/Print.cpp
@@ -2504,6 +2504,11 @@ WasmPrinter::printStackIR(StackIR* ir, std::ostream& o, Function* func) {
switch (inst->op) {
case StackInst::Basic: {
doIndent();
+ // push and pop are pseudo instructions and should not be printed in the
+ // stack IR format to make it valid wat form.
+ if (inst->origin->is<Push>() || inst->origin->is<Pop>()) {
+ break;
+ }
PrintExpressionContents(func, o).visit(inst->origin);
break;
}