Commit 5fbea96a authored by Manos Koukoutos's avatar Manos Koukoutos Committed by V8 LUCI CQ

[wasm-gc] Reserve space before decoding types

We need this because read_heap_type uses the type vector capacity as
out-of-bounds limit.

Bug: chromium:1314496, v8:7748
Change-Id: Id76c8a143c32b20b24356f361d554cb212576c09
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3578654Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79882}
parent b46a3acc
......@@ -675,6 +675,7 @@ class ModuleDecoderImpl : public Decoder {
// Non wasm-gc type section decoding.
if (!enabled_features_.has_gc()) {
module_->types.reserve(types_count);
for (uint32_t i = 0; i < types_count; ++i) {
TRACE("DecodeSignature[%d] module+%d\n", i,
static_cast<int>(pc_ - start_));
......
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