From dce1fe8c16559437cae05c0dd782237474ca6082 Mon Sep 17 00:00:00 2001 From: Jay Phelps Date: Tue, 20 Aug 2019 15:27:58 -0500 Subject: Add initial support for anyref as an opaque type (#2294) Another round of trying to push upstream things from my fork. This PR only adds support for anyref itself as an opaque type. It does NOT implement the full [reference types proposal](https://github.com/WebAssembly/reference-types/blob/master/proposals/reference-types/Overview.md)--so no table.get/set/grow/etc or ref.null, ref.func, etc. Figured it was easier to review and merge as we go, especially if I did something fundamentally wrong. *** I did put it under the `--enable-reference-types` flag as I imagine that even though this PR doesn't complete the full feature set, it probably is the right home. Lmk if not. I'll also be adding a few github comments to places I want to point out/question. --- src/wasm/wasm-validator.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/wasm/wasm-validator.cpp') diff --git a/src/wasm/wasm-validator.cpp b/src/wasm/wasm-validator.cpp index 8eb3341de..339ad6f68 100644 --- a/src/wasm/wasm-validator.cpp +++ b/src/wasm/wasm-validator.cpp @@ -1134,6 +1134,7 @@ void FunctionValidator::validateMemBytes(uint8_t bytes, shouldBeEqual( bytes, uint8_t(16), curr, "expected v128 operation to touch 16 bytes"); break; + case anyref: // anyref cannot be stored in memory case exnref: // exnref cannot be stored in memory case none: WASM_UNREACHABLE(); @@ -1788,6 +1789,7 @@ void FunctionValidator::validateAlignment( case v128: case unreachable: break; + case anyref: // anyref cannot be stored in memory case exnref: // exnref cannot be stored in memory case none: WASM_UNREACHABLE(); -- cgit v1.2.3