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

[wasm-gc] Fix a bug in runtime array.copy

Bug: v8:7748
Change-Id: I1a9787514e105c70ab101aa035e6ee4ae2284ba3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3041434Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75844}
parent e312038d
...@@ -663,7 +663,8 @@ RUNTIME_FUNCTION(Runtime_WasmArrayCopy) { ...@@ -663,7 +663,8 @@ RUNTIME_FUNCTION(Runtime_WasmArrayCopy) {
CONVERT_UINT32_ARG_CHECKED(length, 4); CONVERT_UINT32_ARG_CHECKED(length, 4);
bool overlapping_ranges = bool overlapping_ranges =
dst_array->ptr() == src_array->ptr() && dst_array->ptr() == src_array->ptr() &&
(dst_index + length > src_index || src_index + length > dst_index); (dst_index < src_index ? dst_index + length > src_index
: src_index + length > dst_index);
wasm::ValueType element_type = src_array->type()->element_type(); wasm::ValueType element_type = src_array->type()->element_type();
if (element_type.is_reference()) { if (element_type.is_reference()) {
ObjectSlot dst_slot = dst_array->ElementSlot(dst_index); ObjectSlot dst_slot = dst_array->ElementSlot(dst_index);
......
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