[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:
parent
26d0ca4112
commit
8f3581125a
@ -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());
|
||||
|
8
test/mjsunit/regress/wasm/regress-12866.js
Normal file
8
test/mjsunit/regress/wasm/regress-12866.js
Normal 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));
|
Loading…
Reference in New Issue
Block a user