summaryrefslogtreecommitdiff
path: root/src/wasm.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/wasm.h')
-rw-r--r--src/wasm.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/wasm.h b/src/wasm.h
index 5a48aa3f2..2e383d83b 100644
--- a/src/wasm.h
+++ b/src/wasm.h
@@ -225,7 +225,7 @@ enum HostOp {
class Expression {
public:
- WasmType type;
+ WasmType type; // the type of the expression: its output, not necessarily its input(s)
Expression() : type(type) {}
@@ -607,15 +607,16 @@ public:
class Compare : public Expression {
public:
RelationalOp op;
+ WasmType inputType;
Expression *left, *right;
Compare() {
- type = WasmType::i32;
+ type = WasmType::i32; // output is always i32
}
std::ostream& print(std::ostream &o, unsigned indent) override {
o << '(';
- prepareColor(o) << printWasmType(type) << '.';
+ prepareColor(o) << printWasmType(inputType) << '.';
switch (op) {
case Eq: o << "eq"; break;
case Ne: o << "ne"; break;