Skip to content

zink/ntv: Don't call free() on ralloc'd memory

Erik Faye-Lund requested to merge kusma/mesa:backport-21.1 into staging/21.1

Caught this with an LTO build:

[1465/1465] Linking target src/gallium/targets/dri/libgallium_dri.so In function ‘spirv_shader_delete’, inlined from ‘nir_to_spirv’ at ../src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c:3907:7: ../src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c:3916:4: warning: ‘free’ called on pointer ‘block_1394’ with nonzero offset 48 [-Wfree-nonheap-object] 3916 | FREE(s); | ^ ../src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c: In function ‘nir_to_spirv’: ../src/util/ralloc.c:133:18: note: returned from ‘malloc’ 133 | void *block = malloc(align64(size + sizeof(ralloc_header), | ^

Since s->words is allocated on the same ralloc context we can simplify further by freeing the context all at once.

Reviewed-by: Emma Anholt emma@anholt.net Reviewed-by: Mike Blumenkrantz michael.blumenkrantz@gmail.com Part-of: !10754 (merged)

Merge request reports