diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/passes/Print.cpp | 2 | ||||
-rw-r--r-- | src/wasm-s-parser.h | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp index 3c3cdd659..f365db02f 100644 --- a/src/passes/Print.cpp +++ b/src/passes/Print.cpp @@ -314,7 +314,7 @@ struct PrintSExpression : public WasmVisitor<PrintSExpression, void> { } void visitSelect(Select *curr) { o << '('; - prepareColor(o) << printWasmType(curr->type) << ".select"; + prepareColor(o) << "select"; incIndent(); printFullLine(curr->ifTrue); printFullLine(curr->ifFalse); diff --git a/src/wasm-s-parser.h b/src/wasm-s-parser.h index d0206bcc2..24ca1b811 100644 --- a/src/wasm-s-parser.h +++ b/src/wasm-s-parser.h @@ -524,7 +524,6 @@ public: abort_on(op); } case 's': { - if (op[1] == 'e') return makeSelect(s, type); if (op[1] == 'h') { if (op[2] == 'l') return makeBinary(s, BinaryOp::Shl, type); return makeBinary(s, op[4] == 'u' ? BinaryOp::ShrU : BinaryOp::ShrS, type); @@ -598,7 +597,8 @@ public: abort_on(str); } case 's': { - if (str[1] == 'e') return makeSetLocal(s); + if (str[1] == 'e' && str[2] == 't') return makeSetLocal(s); + if (str[1] == 'e' && str[2] == 'l') return makeSelect(s); abort_on(str); } case 'r': { @@ -637,12 +637,12 @@ private: return ret; } - Expression* makeSelect(Element& s, WasmType type) { + Expression* makeSelect(Element& s) { auto ret = allocator.alloc<Select>(); ret->ifTrue = parseExpression(s[1]); ret->ifFalse = parseExpression(s[2]); ret->condition = parseExpression(s[3]); - ret->type = type; + ret->finalize(); return ret; } |