summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSoni L. <EnderMoneyMod@gmail.com>2024-10-17 14:46:34 -0300
committerGitHub <noreply@github.com>2024-10-17 10:46:34 -0700
commit3bcb05b9b7100688ab166591b02bad1415ba7baf (patch)
tree1c77b552a33f518e63af66315bec63fc22ba8de6
parent2b4e2c7664a61c94fc316a0d526913634c4ff7e6 (diff)
downloadwabt-3bcb05b9b7100688ab166591b02bad1415ba7baf.tar.gz
wabt-3bcb05b9b7100688ab166591b02bad1415ba7baf.tar.bz2
wabt-3bcb05b9b7100688ab166591b02bad1415ba7baf.zip
type.h: Introduce ExnRef (#2489)
-rw-r--r--include/wabt/type.h6
-rw-r--r--src/interp/interp-util.cc3
2 files changed, 8 insertions, 1 deletions
diff --git a/include/wabt/type.h b/include/wabt/type.h
index 96fcf945..c270624c 100644
--- a/include/wabt/type.h
+++ b/include/wabt/type.h
@@ -42,6 +42,7 @@ class Type {
V128 = -0x05, // 0x7b
I8 = -0x06, // 0x7a : packed-type only, used in gc and as v128 lane
I16 = -0x07, // 0x79 : packed-type only, used in gc and as v128 lane
+ ExnRef = -0x0c, // 0x74
FuncRef = -0x10, // 0x70
ExternRef = -0x11, // 0x6f
Reference = -0x15, // 0x6b
@@ -68,7 +69,7 @@ class Type {
bool IsRef() const {
return enum_ == Type::ExternRef || enum_ == Type::FuncRef ||
- enum_ == Type::Reference;
+ enum_ == Type::Reference || enum_ == Type::ExnRef;
}
bool IsReferenceWithIndex() const { return enum_ == Type::Reference; }
@@ -87,6 +88,7 @@ class Type {
case Type::V128: return "v128";
case Type::I8: return "i8";
case Type::I16: return "i16";
+ case Type::ExnRef: return "exnref";
case Type::FuncRef: return "funcref";
case Type::Func: return "func";
case Type::Void: return "void";
@@ -103,6 +105,7 @@ class Type {
switch (enum_) {
case Type::FuncRef: return "func";
case Type::ExternRef: return "extern";
+ case Type::ExnRef: return "exn";
case Type::Struct: return "struct";
case Type::Array: return "array";
default: return "<invalid>";
@@ -145,6 +148,7 @@ class Type {
case Type::F64:
case Type::V128:
case Type::FuncRef:
+ case Type::ExnRef:
case Type::ExternRef:
case Type::Reference:
return TypeVector(this, this + 1);
diff --git a/src/interp/interp-util.cc b/src/interp/interp-util.cc
index 5267f4ae..fcba2c7f 100644
--- a/src/interp/interp-util.cc
+++ b/src/interp/interp-util.cc
@@ -55,6 +55,9 @@ std::string TypedValueToString(const TypedValue& tv) {
case Type::ExternRef:
return StringPrintf("externref:%" PRIzd, tv.value.Get<Ref>().index);
+ case Type::ExnRef:
+ return StringPrintf("exnref:%" PRIzd, tv.value.Get<Ref>().index);
+
case Type::Reference:
case Type::Func:
case Type::Struct: