diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/wasm/wasm-type.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/wasm/wasm-type.cpp b/src/wasm/wasm-type.cpp index cebb1b489..e46e0c6ae 100644 --- a/src/wasm/wasm-type.cpp +++ b/src/wasm/wasm-type.cpp @@ -1038,13 +1038,18 @@ FeatureSet Type::getFeatures() const { heapType.getRecGroup().size() > 1 || heapType.getSuperType()) { return FeatureSet::ReferenceTypes | FeatureSet::GC; } + // Otherwise, this is a function reference, which requires reference types + // and possibly also multivalue (if it has multiple returns). // Note: Technically typed function references also require GC, however, // we use these types internally regardless of the presence of GC (in // particular, since during load of the wasm we don't know the features // yet, so we apply the more refined types), so we don't add that in any // case here. - assert(heapType.isSignature()); - return FeatureSet::ReferenceTypes; + FeatureSet feats = FeatureSet::ReferenceTypes; + if (heapType.getSignature().results.isTuple()) { + feats |= FeatureSet::Multivalue; + } + return feats; } TODO_SINGLE_COMPOUND(t); switch (t.getBasic()) { |