diff options
-rw-r--r-- | src/wasm-s-parser.h | 1 | ||||
-rw-r--r-- | src/wasm.h | 14 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/wasm-s-parser.h b/src/wasm-s-parser.h index 9819c4a60..8f5e08e9d 100644 --- a/src/wasm-s-parser.h +++ b/src/wasm-s-parser.h @@ -636,6 +636,7 @@ private: } else { parseCallOperands(s, 1, ret); } + ret->finalize(); return ret; } diff --git a/src/wasm.h b/src/wasm.h index d9e25783a..4cab41f96 100644 --- a/src/wasm.h +++ b/src/wasm.h @@ -845,6 +845,20 @@ public: } return o; } + + void finalize() { + switch (op) { + case PageSize: case MemorySize: case HasFeature: { + type = i32; + break; + } + case GrowMemory: { + type = none; + break; + } + default: abort(); + } + } }; class Unreachable : public Expression { |