diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/passes/Print.cpp | 2 | ||||
-rw-r--r-- | src/wasm-validator.h | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp index ac349abc7..4f6baa9da 100644 --- a/src/passes/Print.cpp +++ b/src/passes/Print.cpp @@ -481,7 +481,7 @@ struct PrintSExpression : public Visitor<PrintSExpression> { } void visitReturn(Return *curr) { printOpening(o, "return"); - if (!curr->value || curr->value->is<Nop>()) { + if (!curr->value) { // avoid a new line just for the parens o << ')'; return; diff --git a/src/wasm-validator.h b/src/wasm-validator.h index b4818e253..ca89270e9 100644 --- a/src/wasm-validator.h +++ b/src/wasm-validator.h @@ -283,6 +283,7 @@ public: void visitReturn(Return* curr) { if (curr->value) { + shouldBeFalse(curr->value->is<Nop>(), curr, "cannot return a nop"); if (returnType == unreachable) { returnType = curr->value->type; } else if (curr->value->type != unreachable && returnType != curr->value->type) { |