diff options
author | Ben Smith <binji@chromium.org> | 2020-05-28 11:30:38 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-28 11:30:38 -0700 |
commit | bf46c08b05fc6fcc457f1657e936fab24b4dceee (patch) | |
tree | f57a19c670a3e222896c252c829d5eb5ec4db6d2 /src/interp/interp-inl.h | |
parent | 0630dc53755678239d7609b61776b125221eefb8 (diff) | |
download | wabt-bf46c08b05fc6fcc457f1657e936fab24b4dceee.tar.gz wabt-bf46c08b05fc6fcc457f1657e936fab24b4dceee.tar.bz2 wabt-bf46c08b05fc6fcc457f1657e936fab24b4dceee.zip |
Reference types changes to remove subtyping (#1407)
Main changes:
* Rename `anyref` -> `externref`
* Remove `nullref`
* Rename `hostref` -> `externref`
* `ref.null` and `ref.is_null` now have "ref kind" parameter
* Add ref kind keywords: `func`, `extern`, `exn`
Diffstat (limited to 'src/interp/interp-inl.h')
-rw-r--r-- | src/interp/interp-inl.h | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/interp/interp-inl.h b/src/interp/interp-inl.h index 7650ff1b..0d306ebe 100644 --- a/src/interp/interp-inl.h +++ b/src/interp/interp-inl.h @@ -365,16 +365,9 @@ template <typename T> void RequireType(ValueType type) { } inline bool TypesMatch(ValueType expected, ValueType actual) { - if (expected == actual) { - return true; - } - if (!IsReference(expected)) { - return false; - } - if (expected == ValueType::Anyref || actual == ValueType::Nullref) { - return true; - } - return false; + // Currently there is no subtyping, so expected and actual must match + // exactly. In the future this may be expanded. + return expected == actual; } //// Value //// |