From a4d9fa592dc3bf6816d19239d02b2c11a36d35e2 Mon Sep 17 00:00:00 2001 From: Ranjith Ramakrishnan Date: Thu, 6 Jul 2023 11:43:37 -0700 Subject: [PATCH] Use memset for initializing variable sized array In ASAN builds, the compiler used is clang. The initialization of variable sized array using assignment operator is causing compilation failure in ASAN builds. Used memset to fix the same. Change-Id: Ifc748291a41a9886243e0fb1ba576d2760f5e15e [ROCm/ROCR-Runtime commit: cd4632ccbcb26bd5424298fd458a3bfe0b4bebc0] --- .../rocr-runtime/runtime/hsa-runtime/core/runtime/signal.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/signal.cpp b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/signal.cpp index 6c14820b01..3d554a03b7 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/signal.cpp +++ b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/signal.cpp @@ -231,7 +231,8 @@ uint32_t Signal::WaitAny(uint32_t signal_count, const hsa_signal_t* hsa_signals, if (signal_count > small_size) delete[] evts; }); - uint64_t event_age[unique_evts] = {0}; + uint64_t event_age[unique_evts]; + memset(event_age, 0, unique_evts * sizeof(uint64_t)); if (core::Runtime::runtime_singleton_->KfdVersion().supports_event_age) for (uint32_t i = 0; i < unique_evts; i++) event_age[i] = 1;