Commit c24739fa authored by Jakob Kummerow's avatar Jakob Kummerow Committed by Commit Bot

[wasm] Fix "unreachable" code for invalid modules

Better return a validation error than assume that invalid modules
can't reach invalid code paths. ClusterFuzz prefers errors over
crashes.

Bug: chromium:1084389
Change-Id: I67f0c2f48022cff8a7821901ddfdd42fa2c4a5c6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2209059
Auto-Submit: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67920}
parent 7a85e029
......@@ -1636,7 +1636,9 @@ class WasmDecoder : public Decoder {
return 2;
default:
UNREACHABLE();
// This is unreachable except for malformed modules.
decoder->error(pc, "invalid gc opcode");
return 2;
}
}
default:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment