[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 <clemensh@chromium.org>
Reviewed-by: Ben Titzer <titzer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48490}
This commit is contained in:
Clemens Hammacher 2017-10-12 09:26:57 +02:00 committed by Commit Bot
parent ab15efa392
commit a0cde81112

View File

@ -1470,7 +1470,7 @@ class WasmFullDecoder : public WasmDecoder<validate> {
" (previous was %u, this one %u)",
i, br_arity, arity);
}
if (!VALIDATE(TypeCheckBreak(target))) break;
if (!TypeCheckBreak(target)) break;
}
if (!VALIDATE(this->ok())) break;