Commit 563ba6c4 authored by Jakob Kummerow's avatar Jakob Kummerow Committed by Commit Bot

[wasm-gc] Fix ClusterFuzz issues

Random-generated modules can take surprising code paths.

Bug: chromium:1072127, chromium:1072115
Change-Id: Id9973ebe5942e95e6006026c8cbf875d826d355a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2156765Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Auto-Submit: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67243}
parent 9f6eb557
......@@ -1726,7 +1726,10 @@ class ModuleDecoderImpl : public Decoder {
break;
case kLocalI31Ref:
case kLocalRttRef:
UNIMPLEMENTED(); // TODO(7748): Add i31ref and rttref.
if (enabled_features_.has_gc()) {
UNIMPLEMENTED(); // TODO(7748): implement.
}
break;
default:
break;
}
......
......@@ -369,6 +369,10 @@ const char* WasmOpcodes::OpcodeName(WasmOpcode opcode) {
return "unknown";
// clang-format on
}
// Even though the switch above handles all well-defined enum values,
// random modules (e.g. fuzzer generated) can call this function with
// random (invalid) opcodes. Handle those here:
return "invalid opcode";
}
#undef CASE_OP
......
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