[wasm-gc] Fix instantiation of modules with no types

Fixed: v8:12866
Change-Id: Icba2ffc7837bf4942fd4bc741abeb7c98694c2d8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3644607
Reviewed-by: Manos Koukoutos <manoskouk@chromium.org>
Auto-Submit: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Andy Wingo <wingo@igalia.com>
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#80500}
This commit is contained in:
Jakob Kummerow 2022-05-12 14:06:08 +02:00 committed by V8 LUCI CQ
parent 26d0ca4112
commit 8f3581125a
2 changed files with 10 additions and 1 deletions

View File

@ -661,7 +661,8 @@ MaybeHandle<WasmInstanceObject> InstanceBuilder::Build() {
// list.
//--------------------------------------------------------------------------
if (enabled_.has_gc()) {
if (FLAG_wasm_type_canonicalization) {
if (FLAG_wasm_type_canonicalization &&
module_->isorecursive_canonical_type_ids.size() > 0) {
uint32_t maximum_canonical_type_index =
*std::max_element(module_->isorecursive_canonical_type_ids.begin(),
module_->isorecursive_canonical_type_ids.end());

View File

@ -0,0 +1,8 @@
// Copyright 2022 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --experimental-wasm-gc
let empty_module = Uint8Array.from([0, 97, 115, 109, 1, 0, 0, 0]);
new WebAssembly.Instance(new WebAssembly.Module(empty_module));