From bb528d5ad6f28e9c1bc4e283d40c70489465bd00 Mon Sep 17 00:00:00 2001 From: SendaoYan Date: Thu, 30 Jan 2025 08:55:40 +0000 Subject: [PATCH] 8348567: [ASAN] Memory access partially overflows by NativeCallStack Reviewed-by: jsjolen, dholmes --- test/hotspot/gtest/nmt/test_nmt_nativecallstackstorage.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/hotspot/gtest/nmt/test_nmt_nativecallstackstorage.cpp b/test/hotspot/gtest/nmt/test_nmt_nativecallstackstorage.cpp index 7ff18dc794e..b4b43c92cf1 100644 --- a/test/hotspot/gtest/nmt/test_nmt_nativecallstackstorage.cpp +++ b/test/hotspot/gtest/nmt/test_nmt_nativecallstackstorage.cpp @@ -42,7 +42,7 @@ TEST_VM_F(NMTNativeCallStackStorageTest, DoNotStoreStackIfNotDetailed) { TEST_VM_F(NMTNativeCallStackStorageTest, CollisionsReceiveDifferentIndexes) { constexpr const int nr_of_stacks = 10; NativeCallStack ncs_arr[nr_of_stacks]; - for (int i = 0; i < nr_of_stacks; i++) { + for (size_t i = 0; i < nr_of_stacks; i++) { ncs_arr[i] = NativeCallStack((address*)(&i), 1); } @@ -52,7 +52,7 @@ TEST_VM_F(NMTNativeCallStackStorageTest, CollisionsReceiveDifferentIndexes) { si_arr[i] = ncss.push(ncs_arr[i]); } - // Every SI should be different as every sack is different + // Every SI should be different as every stack is different for (int i = 0; i < nr_of_stacks; i++) { for (int j = 0; j < nr_of_stacks; j++) { if (i == j) continue;