summaryrefslogtreecommitdiff
path: root/src/validator.cc
diff options
context:
space:
mode:
authorYury Delendik <ydelendik@mozilla.com>2019-09-12 07:35:32 -0500
committerGitHub <noreply@github.com>2019-09-12 07:35:32 -0500
commit99bb044a796b3c4bd3c292c11092de0e21d59ea9 (patch)
treed7ef95ff8f91856753ed944401dfaffc375670cb /src/validator.cc
parent3e938b7a10cc6738037dce5f18675cc5d267992d (diff)
downloadwabt-99bb044a796b3c4bd3c292c11092de0e21d59ea9.tar.gz
wabt-99bb044a796b3c4bd3c292c11092de0e21d59ea9.tar.bz2
wabt-99bb044a796b3c4bd3c292c11092de0e21d59ea9.zip
Add ref.* to the (invoke) (#1156)
Diffstat (limited to 'src/validator.cc')
-rw-r--r--src/validator.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/validator.cc b/src/validator.cc
index e10db823..01bd6c8c 100644
--- a/src/validator.cc
+++ b/src/validator.cc
@@ -412,7 +412,7 @@ void Validator::CheckType(const Location* loc,
Type actual,
Type expected,
const char* desc) {
- if (expected != actual) {
+ if (Failed(TypeChecker::CheckType(actual, expected))) {
PrintError(loc, "type mismatch at %s. got %s, expected %s", desc,
GetTypeName(actual), GetTypeName(expected));
}
@@ -424,7 +424,7 @@ void Validator::CheckTypeIndex(const Location* loc,
const char* desc,
Index index,
const char* index_kind) {
- if (expected != actual && expected != Type::Any && actual != Type::Any) {
+ if (Failed(TypeChecker::CheckType(actual, expected))) {
PrintError(
loc, "type mismatch for %s %" PRIindex " of %s. got %s, expected %s",
index_kind, index, desc, GetTypeName(actual), GetTypeName(expected));
@@ -1070,7 +1070,7 @@ void Validator::CheckConstInitExpr(const Location* loc,
}
case ExprType::RefNull:
- type = Type::Anyref;
+ type = Type::Nullref;
break;
default: