spirv: Assert that vtn_pointer_to_deref() doesn't return NULL

There are a few things that could cause us to return NULL here and we
should just fail to parse the SPIR-V if that ever happens instead of
crashing when someone tries to access it.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36427>
This commit is contained in:
Faith Ekstrand 2025-07-21 15:03:01 -04:00 committed by Marge Bot
parent 8a993cf900
commit d1be63c355

View file

@ -524,6 +524,8 @@ vtn_pointer_to_deref(struct vtn_builder *b, struct vtn_pointer *ptr)
ptr = vtn_pointer_dereference(b, ptr, &chain);
}
vtn_assert(ptr->deref != NULL);
return ptr->deref;
}