From dce52be686ec4d2cff8ecefa48baf144e7c487de Mon Sep 17 00:00:00 2001 From: Sunday Clement Date: Fri, 30 May 2025 15:32:44 -0400 Subject: [PATCH] rocr: Fix Unintentional Integer Overflow Its safer to have the integer literal explicitly be an unsigned long in this expression as that's what the type of the errorCode variable resolves to, preventing any overflow errors. Signed-off-by: Sunday Clement --- runtime/hsa-runtime/core/runtime/amd_aql_queue.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/hsa-runtime/core/runtime/amd_aql_queue.cpp b/runtime/hsa-runtime/core/runtime/amd_aql_queue.cpp index be06da3dc8..32d5c86c8f 100644 --- a/runtime/hsa-runtime/core/runtime/amd_aql_queue.cpp +++ b/runtime/hsa-runtime/core/runtime/amd_aql_queue.cpp @@ -1181,7 +1181,7 @@ bool AqlQueue::ExceptionHandler(hsa_signal_value_t error_code, void* arg) { } for (auto& error : QueueErrors) { - if (error_code & (1 << (error.code - 1))) { + if (error_code & (1UL << (error.code - 1))) { errorCode = error.status; break; }