anv: assert that the target bo is valid when adding a reloc list
this catches some undefined behavior like e.g., using a stale descriptorset that references deleted bos, which I would absolutely never do Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6747>
This commit is contained in:
parent
355f241d41
commit
b75a92e201
|
@ -200,6 +200,8 @@ anv_reloc_list_add(struct anv_reloc_list *list,
|
|||
if (result != VK_SUCCESS)
|
||||
return result;
|
||||
|
||||
assert(target_bo->gem_handle > 0 && target_bo->refcount > 0);
|
||||
|
||||
/* XXX: Can we use I915_EXEC_HANDLE_LUT? */
|
||||
index = list->num_relocs++;
|
||||
list->reloc_bos[index] = target_bo;
|
||||
|
|
Loading…
Reference in New Issue