[fuzzer][wasm] Fix struct.new_default for immutable structs
struct.new_default may not be called for immutable structs.
Follow-up to d2c75d321e
.
Change-Id: I7b682938ca5da00ef6c9bec29856133301beb6b4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3802688
Auto-Submit: Matthias Liedtke <mliedtke@chromium.org>
Commit-Queue: Matthias Liedtke <mliedtke@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82108}
This commit is contained in:
parent
0505419a1e
commit
9182c028c1
@ -862,8 +862,10 @@ class WasmGenerator {
|
||||
bool can_be_defaultable = std::all_of(
|
||||
struct_gen->fields().begin(), struct_gen->fields().end(),
|
||||
[](ValueType type) -> bool { return type.is_defaultable(); });
|
||||
|
||||
if (new_default && can_be_defaultable) {
|
||||
bool is_mutable = std::all_of(
|
||||
struct_gen->mutabilities().begin(), struct_gen->mutabilities().end(),
|
||||
[](bool mutability) -> bool { return mutability; });
|
||||
if (new_default && can_be_defaultable && is_mutable) {
|
||||
builder_->EmitWithPrefix(kExprStructNewDefault);
|
||||
builder_->EmitU32V(index);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user