From 3d281114fb4c39ea5457c5c40297392bd807ffcb Mon Sep 17 00:00:00 2001 From: Tao Sang Date: Wed, 19 Oct 2022 22:52:45 -0400 Subject: [PATCH] SWDEV-360706 - Fix WriteAqlArgAt() crash in X86 In X86 on Windows, sizeof(size_t)=4, but size=8, for amd::KernelParameterDescriptor::HiddenGlobalOffsetX/Y/Z items. Loose the condition to prevent crash. Change-Id: I2216f71f4d4fd6dd3766023b1c821cb3d35d7848 --- rocclr/device/device.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rocclr/device/device.hpp b/rocclr/device/device.hpp index 1d03f90afb..c93fe5016b 100644 --- a/rocclr/device/device.hpp +++ b/rocclr/device/device.hpp @@ -228,7 +228,7 @@ inline void WriteAqlArgAt(unsigned char* dst, //!< The write pointer to the buff uint size, //!< The size in bytes to copy size_t offset //!< The alignment to follow while writing to the buffer ) { - assert(sizeof(T) == size && "Argument's size mismatches ABI!"); + assert(sizeof(T) <= size && "Argument's size mismatches ABI!"); *(reinterpret_cast(dst + offset)) = src; }