diff options
Diffstat (limited to 'src/wasm/wasm.cpp')
-rw-r--r-- | src/wasm/wasm.cpp | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/src/wasm/wasm.cpp b/src/wasm/wasm.cpp index 9d43a33b1..d3c0b46e8 100644 --- a/src/wasm/wasm.cpp +++ b/src/wasm/wasm.cpp @@ -145,8 +145,10 @@ const char* getExpressionName(Expression* curr) { return "drop"; case Expression::Id::ReturnId: return "return"; - case Expression::Id::HostId: - return "host"; + case Expression::Id::MemorySizeId: + return "memory.size"; + case Expression::Id::MemoryGrowId: + return "memory.grow"; case Expression::Id::NopId: return "nop"; case Expression::Id::UnreachableId: @@ -879,21 +881,13 @@ void Drop::finalize() { } } -void Host::finalize() { - switch (op) { - case MemorySize: { - type = Type::i32; - break; - } - case MemoryGrow: { - // if the single operand is not reachable, so are we - if (operands[0]->type == Type::unreachable) { - type = Type::unreachable; - } else { - type = Type::i32; - } - break; - } +void MemorySize::finalize() { type = Type::i32; } + +void MemoryGrow::finalize() { + if (delta->type == Type::unreachable) { + type = Type::unreachable; + } else { + type = Type::i32; } } |