Change WASM_ANYREF to WASM_EXTERNREF (#3426)

wasm-c-api wasm.h had changed WASM_ANYREF to WASM_EXTERNREF,
we had better change it in WAMR also:
2ce1367c9d/include/wasm.h (L185)
This commit is contained in:
Wenyong Huang
2024-05-14 11:08:16 +08:00
committed by GitHub
parent 004d07bb86
commit 773efc006d
12 changed files with 42 additions and 42 deletions

View File

@ -213,7 +213,7 @@ WASM_I32 = 0
WASM_I64 = 1
WASM_F32 = 2
WASM_F64 = 3
WASM_ANYREF = 128
WASM_EXTERNREF = 128
WASM_FUNCREF = 129
def wasm_valtype_new(arg0):

View File

@ -180,7 +180,7 @@ def __repr_wasm_valtype_t(self):
elif WASM_FUNCREF == val_kind:
return "funcref"
else:
return "anyref"
return "externref"
wasm_valtype_t.__eq__ = __compare_wasm_valtype_t
@ -406,7 +406,7 @@ def __compare_wasm_val_t(self, other):
return self.of.f32 == other.of.f32
elif WASM_F64 == self.kind:
return self.of.f64 == other.of.f63
elif WASM_ANYREF == self.kind:
elif WASM_EXTERNREF == self.kind:
raise RuntimeError("FIXME")
else:
raise RuntimeError("not a valid val kind")
@ -421,8 +421,8 @@ def __repr_wasm_val_t(self):
return f"f32 {self.of.f32}"
elif WASM_F64 == self.kind:
return f"f64 {self.of.f64}"
elif WASM_ANYREF == self.kind:
return f"anyref {self.of.ref}"
elif WASM_EXTERNREF == self.kind:
return f"externref {self.of.ref}"
else:
raise RuntimeError("not a valid val kind")

View File

@ -61,7 +61,7 @@ class BasicTestSuite(unittest.TestCase):
def test_wasm_valkind(self):
self.assertEqual(
[WASM_I32, WASM_I64, WASM_F32, WASM_F64, WASM_ANYREF, WASM_FUNCREF],
[WASM_I32, WASM_I64, WASM_F32, WASM_F64, WASM_EXTERNREF, WASM_FUNCREF],
[0, 1, 2, 3, 128, 129],
)