Skip to content

Commit 2c1b311

Browse files
committed
8331854: ubsan: copy.hpp:218:10: runtime error: addition of unsigned offset to 0x7fc2b4024518 overflowed to 0x7fc2b4024510
Reviewed-by: kvn, clanger
1 parent 765ad0e commit 2c1b311

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/hotspot/share/utilities/copy.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ class Copy : AllStatic {
211211
// byte_count is in bytes to check its alignment
212212
assert_params_ok(from, to, HeapWordSize);
213213
assert_byte_count_ok(byte_count, HeapWordSize);
214+
if (byte_count == 0) return;
214215

215216
size_t count = align_up(byte_count, HeapWordSize) >> LogHeapWordSize;
216217
assert(from <= to || to + count <= from, "do not overwrite source data");

0 commit comments

Comments
 (0)