summaryrefslogtreecommitdiff
path: root/src/wasm
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2021-09-07 12:34:22 -0700
committerGitHub <noreply@github.com>2021-09-07 12:34:22 -0700
commitffdae24a98ecc3f559c3bb02dcdfd79764f971db (patch)
tree2117e310da5224a5259bb2eec3ec21e27f4d2f94 /src/wasm
parentbf21a66e1b6d68407c941a9534bc1cd76d329bf2 (diff)
downloadbinaryen-ffdae24a98ecc3f559c3bb02dcdfd79764f971db.tar.gz
binaryen-ffdae24a98ecc3f559c3bb02dcdfd79764f971db.tar.bz2
binaryen-ffdae24a98ecc3f559c3bb02dcdfd79764f971db.zip
Show a clear error on asyncify+references. (#4125)
Helps #3739
Diffstat (limited to 'src/wasm')
-rw-r--r--src/wasm/wasm-type.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/wasm/wasm-type.cpp b/src/wasm/wasm-type.cpp
index 34d7e942f..e86843f10 100644
--- a/src/wasm/wasm-type.cpp
+++ b/src/wasm/wasm-type.cpp
@@ -922,6 +922,19 @@ unsigned Type::getByteSize() const {
return getSingleByteSize(*this);
}
+unsigned Type::hasByteSize() const {
+ auto hasSingleByteSize = [](Type t) { return t.isNumber(); };
+ if (isTuple()) {
+ for (const auto& t : *this) {
+ if (!hasSingleByteSize(t)) {
+ return false;
+ }
+ }
+ return true;
+ }
+ return hasSingleByteSize(*this);
+}
+
Type Type::reinterpret() const {
assert(!isTuple() && "Unexpected tuple type");
switch ((*begin()).getBasic()) {