summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/wasm/wasm-type.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/wasm/wasm-type.cpp b/src/wasm/wasm-type.cpp
index aed13b6d1..30bd74e6a 100644
--- a/src/wasm/wasm-type.cpp
+++ b/src/wasm/wasm-type.cpp
@@ -138,8 +138,11 @@ Type::Type(std::initializer_list<Type> types) { init(types); }
Type::Type(const std::vector<Type>& types) { init(types); }
Type::Type(uint32_t _id) {
- id = _id;
- {
+ if (_id <= last_value_type) {
+ *this = Type(static_cast<ValueType>(_id));
+ } else {
+ id = _id;
+ // Unknown complex type; look up the size
std::shared_lock<std::shared_timed_mutex> lock(mutex);
_size = typeLists[id]->size();
}