From a0cde811123a5513ab7b2669ccedd4aee1891e72 Mon Sep 17 00:00:00 2001 From: Clemens Hammacher Date: Thu, 12 Oct 2017 09:26:57 +0200 Subject: [PATCH] [wasm] [decoder] Fix incorrect use of VALIDATE macro The VALIDATE macro should only be used for tests that do not have any side effect, because the side effect will only be executed if validation is active or in debug builds (because the condition is DCHECKed there). The TypeCheckBreak method has side effects since a while, since it inserts unreachable values on the stack. This did not lead to failures so far, since we only have validating users of the WasmFullDecoder. This will change once we have general lazy compilation of wasm modules, e.g. for tier-up. R=titzer@chromium.org Change-Id: I7b34dfd9297122616fa9ebdf899d9f44ca60273b Reviewed-on: https://chromium-review.googlesource.com/715416 Commit-Queue: Clemens Hammacher Reviewed-by: Ben Titzer Cr-Commit-Position: refs/heads/master@{#48490} --- src/wasm/function-body-decoder-impl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wasm/function-body-decoder-impl.h b/src/wasm/function-body-decoder-impl.h index f9d60beabc..bfd687f25c 100644 --- a/src/wasm/function-body-decoder-impl.h +++ b/src/wasm/function-body-decoder-impl.h @@ -1470,7 +1470,7 @@ class WasmFullDecoder : public WasmDecoder { " (previous was %u, this one %u)", i, br_arity, arity); } - if (!VALIDATE(TypeCheckBreak(target))) break; + if (!TypeCheckBreak(target)) break; } if (!VALIDATE(this->ok())) break;