summaryrefslogtreecommitdiff
path: root/src/wasm/literal.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/wasm/literal.cpp')
-rw-r--r--src/wasm/literal.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/wasm/literal.cpp b/src/wasm/literal.cpp
index 91fc91e1e..e22088d9c 100644
--- a/src/wasm/literal.cpp
+++ b/src/wasm/literal.cpp
@@ -100,6 +100,7 @@ Literal::Literal(const Literal& other) : type(other.type) {
i32 = other.i32;
return;
case HeapType::func:
+ case HeapType::data:
case HeapType::exn:
WASM_UNREACHABLE("invalid type");
}
@@ -126,6 +127,7 @@ Literal::Literal(const Literal& other) : type(other.type) {
case Type::exnref:
case Type::anyref:
case Type::eqref:
+ case Type::dataref:
case Type::i31ref:
WASM_UNREACHABLE("invalid type");
}
@@ -350,6 +352,7 @@ void Literal::getBits(uint8_t (&buf)[16]) const {
case Type::exnref:
case Type::anyref:
case Type::eqref:
+ case Type::dataref:
case Type::i31ref:
WASM_UNREACHABLE("invalid type");
}
@@ -393,6 +396,7 @@ bool Literal::operator==(const Literal& other) const {
case Type::externref:
case Type::exnref:
case Type::anyref:
+ case Type::dataref:
case Type::eqref:
return compareRef();
case Type::unreachable:
@@ -539,8 +543,9 @@ std::ostream& operator<<(std::ostream& o, Literal literal) {
case HeapType::i31:
o << "i31ref(" << literal.geti31() << ")";
break;
+ case HeapType::data:
case HeapType::func:
- WASM_UNREACHABLE("invalid type");
+ WASM_UNREACHABLE("type should have been handled above");
}
}
} else if (literal.type.isRtt()) {
@@ -576,6 +581,7 @@ std::ostream& operator<<(std::ostream& o, Literal literal) {
case Type::exnref:
case Type::anyref:
case Type::eqref:
+ case Type::dataref:
case Type::i31ref:
case Type::unreachable:
WASM_UNREACHABLE("unexpected type");
@@ -804,6 +810,7 @@ Literal Literal::eqz() const {
case Type::exnref:
case Type::anyref:
case Type::eqref:
+ case Type::dataref:
case Type::i31ref:
case Type::none:
case Type::unreachable:
@@ -828,6 +835,7 @@ Literal Literal::neg() const {
case Type::exnref:
case Type::anyref:
case Type::eqref:
+ case Type::dataref:
case Type::i31ref:
case Type::none:
case Type::unreachable:
@@ -852,6 +860,7 @@ Literal Literal::abs() const {
case Type::exnref:
case Type::anyref:
case Type::eqref:
+ case Type::dataref:
case Type::i31ref:
case Type::none:
case Type::unreachable:
@@ -993,6 +1002,7 @@ Literal Literal::add(const Literal& other) const {
case Type::exnref:
case Type::anyref:
case Type::eqref:
+ case Type::dataref:
case Type::i31ref:
case Type::none:
case Type::unreachable:
@@ -1017,6 +1027,7 @@ Literal Literal::sub(const Literal& other) const {
case Type::exnref:
case Type::anyref:
case Type::eqref:
+ case Type::dataref:
case Type::i31ref:
case Type::none:
case Type::unreachable:
@@ -1112,6 +1123,7 @@ Literal Literal::mul(const Literal& other) const {
case Type::exnref:
case Type::anyref:
case Type::eqref:
+ case Type::dataref:
case Type::i31ref:
case Type::none:
case Type::unreachable:
@@ -1348,6 +1360,7 @@ Literal Literal::eq(const Literal& other) const {
case Type::exnref:
case Type::anyref:
case Type::eqref:
+ case Type::dataref:
case Type::i31ref:
case Type::none:
case Type::unreachable:
@@ -1372,6 +1385,7 @@ Literal Literal::ne(const Literal& other) const {
case Type::exnref:
case Type::anyref:
case Type::eqref:
+ case Type::dataref:
case Type::i31ref:
case Type::none:
case Type::unreachable: