From 8d37ab6bfa0321674fe74cc4c76c21aa94d36840 Mon Sep 17 00:00:00 2001 From: Bas Nieuwenhuizen Date: Sat, 19 Nov 2022 03:28:56 +0100 Subject: [PATCH] radv: Fix custom build id with C90 compilation. Seems some build configurations have problems with VLAs still. Fixes: 97641e5c942 ("radv: Add ability to override the build id for the cache.") Part-of: --- src/amd/vulkan/radv_device.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c index a909ac5..1958816 100644 --- a/src/amd/vulkan/radv_device.c +++ b/src/amd/vulkan/radv_device.c @@ -117,9 +117,10 @@ radv_device_get_cache_uuid(struct radv_physical_device *pdevice, void *uuid) #ifdef RADV_BUILD_ID_OVERRIDE { - char data[strlen(RADV_BUILD_ID_OVERRIDE) / 2]; - parse_hex(data, RADV_BUILD_ID_OVERRIDE, ARRAY_SIZE(data)); - _mesa_sha1_update(&ctx, data, ARRAY_SIZE(data)); + unsigned size = strlen(RADV_BUILD_ID_OVERRIDE) / 2; + char *data = alloca(size); + parse_hex(data, RADV_BUILD_ID_OVERRIDE, size); + _mesa_sha1_update(&ctx, data, size); } #else if (!disk_cache_get_function_identifier(radv_device_get_cache_uuid, &ctx)) -- 2.7.4