diff options
author | Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> | 2019-06-10 16:17:46 +0200 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2019-06-20 10:32:36 -0700 |
commit | 449b24aa06a6a33c0d1b05686a8b3c71e16a8ae5 (patch) | |
tree | 2f5ad407eaf8588cbf7c610fb8d2c1b1b48c66f8 | |
parent | c7ff7af2621aea9e7f668c8c5d991608ce883502 (diff) | |
download | mesa-449b24aa06a6a33c0d1b05686a8b3c71e16a8ae5.tar.gz |
radv: Prevent out of bound shift on 32-bit builds.
uintptr_t is 32-bits then and shifting it by 32 bits results in undefined
behavior IIRC.
Fixes: b3c8de1c55c "radv: save all descriptor pointers into the trace BO"
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
(cherry picked from commit 39c71e002561052d0596200b2d0ebdb8cc39d862)
-rw-r--r-- | src/amd/vulkan/radv_cmd_buffer.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c index ab0016d0277..1481a806fd0 100644 --- a/src/amd/vulkan/radv_cmd_buffer.c +++ b/src/amd/vulkan/radv_cmd_buffer.c @@ -566,8 +566,8 @@ radv_save_descriptors(struct radv_cmd_buffer *cmd_buffer, for_each_bit(i, descriptors_state->valid) { struct radv_descriptor_set *set = descriptors_state->sets[i]; - data[i * 2] = (uintptr_t)set; - data[i * 2 + 1] = (uintptr_t)set >> 32; + data[i * 2] = (uint64_t)(uintptr_t)set; + data[i * 2 + 1] = (uint64_t)(uintptr_t)set >> 32; } radv_emit_write_data_packet(cmd_buffer, va, MAX_SETS * 2, data); |