Skip to content

Commit 5aaf0b9

Browse files
thibaudmichaudguybedford
authored andcommitted
deps: V8: cherry-pick e7ccf0af1bdd
Original commit message: [wasm] Fix default externref/exnref reference - The default nullexternref should be null instead of undefined - The default exnref/nullexnref should be null instead of wasm_null [email protected] Fixed: 372285204,372269618 Change-Id: Id5addce2b196f7ba81aac3c2dd9447a91ed2ce2b Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5922878 Commit-Queue: Thibaud Michaud <[email protected]> Reviewed-by: Matthias Liedtke <[email protected]> Cr-Commit-Position: refs/heads/main@{#96531} Refs: v8/v8@e7ccf0a
1 parent 5a98962 commit 5aaf0b9

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

deps/v8/src/wasm/wasm-js.cc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1281,9 +1281,12 @@ i::Handle<i::HeapObject> DefaultReferenceValue(i::Isolate* isolate,
12811281
DCHECK(type.is_object_reference());
12821282
// Use undefined for JS type (externref) but null for wasm types as wasm does
12831283
// not know undefined.
1284-
if (type.heap_representation() == i::wasm::HeapType::kExtern ||
1285-
type.heap_representation() == i::wasm::HeapType::kNoExtern) {
1284+
if (type.heap_representation() == i::wasm::HeapType::kExtern) {
12861285
return isolate->factory()->undefined_value();
1286+
} else if (type.heap_representation() == i::wasm::HeapType::kNoExtern ||
1287+
type.heap_representation() == i::wasm::HeapType::kExn ||
1288+
type.heap_representation() == i::wasm::HeapType::kNoExn) {
1289+
return isolate->factory()->null_value();
12871290
}
12881291
return isolate->factory()->wasm_null();
12891292
}

0 commit comments

Comments
 (0)