summaryrefslogtreecommitdiff
path: root/src/wasm.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/wasm.h')
-rw-r--r--src/wasm.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/wasm.h b/src/wasm.h
index c4654580a..306804c66 100644
--- a/src/wasm.h
+++ b/src/wasm.h
@@ -540,6 +540,8 @@ public:
WasmType result;
std::vector<WasmType> params;
+ FunctionType() : result(none) {}
+
std::ostream& print(std::ostream &o, unsigned indent, bool full=false) {
if (full) {
printOpening(o, "type") << ' ' << name << " (func";
@@ -938,13 +940,15 @@ public:
class Import {
public:
Name name, module, base; // name = module.base
- FunctionType type;
+ FunctionType* type;
+
+ Import() : type(nullptr) {}
std::ostream& print(std::ostream &o, unsigned indent) {
printOpening(o, "import ") << name << ' ';
printText(o, module.str) << ' ';
printText(o, base.str);
- type.print(o, indent);
+ if (type) type->print(o, indent);
return o << ')';
}
};