From d8f2ddd4d680b059c2daded7f57051bf21d77297 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Wed, 2 Jun 2021 13:24:22 -0700 Subject: [Wasm GC] Add negated BrOn* operations (#3913) They are basically the flip versions. The only interesting part in the impl is that their returned typed and sent types are different. Spec: https://docs.google.com/document/d/1DklC3qVuOdLHSXB5UXghM_syCh-4cMinQ50ICiXnK3Q/edit --- src/wasm/wasm-validator.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/wasm/wasm-validator.cpp') diff --git a/src/wasm/wasm-validator.cpp b/src/wasm/wasm-validator.cpp index 10b60e0a7..bbc92f09c 100644 --- a/src/wasm/wasm-validator.cpp +++ b/src/wasm/wasm-validator.cpp @@ -2245,14 +2245,14 @@ void FunctionValidator::visitBrOn(BrOn* curr) { shouldBeTrue( curr->ref->type.isRef(), curr, "br_on_cast ref must have ref type"); } - if (curr->op == BrOnCast) { + if (curr->op == BrOnCast || curr->op == BrOnCastFail) { // Note that an unreachable rtt is not supported: the text and binary // formats do not provide the type, so if it's unreachable we should not // even create a br_on_cast in such a case, as we'd have no idea what it // casts to. shouldBeTrue( curr->rtt->type.isRtt(), curr, "br_on_cast rtt must have rtt type"); - noteBreak(curr->name, curr->getCastType(), curr); + noteBreak(curr->name, curr->getSentType(), curr); } else { shouldBeTrue(curr->rtt == nullptr, curr, "non-cast BrOn must not have rtt"); } -- cgit v1.2.3