[Mesa-dev] [PATCH] anv: Improve the asserts in anv_buffer_get_range
Lionel Landwerlin
lionel.g.landwerlin at intel.com
Fri Oct 26 22:29:58 UTC 2018
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
On 26/10/2018 19:28, Jason Ekstrand wrote:
> ---
> src/intel/vulkan/anv_private.h | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h
> index 25e290ed112..d8a08d9d67f 100644
> --- a/src/intel/vulkan/anv_private.h
> +++ b/src/intel/vulkan/anv_private.h
> @@ -1705,7 +1705,8 @@ anv_buffer_get_range(struct anv_buffer *buffer, uint64_t offset, uint64_t range)
> if (range == VK_WHOLE_SIZE) {
> return buffer->size - offset;
> } else {
> - assert(range <= buffer->size);
> + assert(range + offset >= range);
> + assert(range + offset <= buffer->size);
> return range;
> }
> }
More information about the mesa-dev
mailing list