tint/reader/spirv: Work around pointers to null store types.

Bug: tint:1838
Change-Id: I84564a1b9888634808af2a1c7bb1e77c80947216
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/119700
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: David Neto <dneto@google.com>
This commit is contained in:
Ben Clayton 2023-02-13 21:22:21 +00:00 committed by Dawn LUCI CQ
parent 151913d29b
commit a5b9e96b39
1 changed files with 6 additions and 0 deletions

View File

@ -180,6 +180,12 @@ Pointer::Pointer(const Type* t, type::AddressSpace s, type::Access a)
Pointer::Pointer(const Pointer&) = default;
const ast::Type* Pointer::Build(ProgramBuilder& b) const {
auto store_type = type->Build(b);
if (!store_type) {
// TODO(crbug.com/tint/1838): We should not be constructing pointers with 'void' store
// types.
return b.ty("invalid_spirv_ptr_type");
}
return b.ty.pointer(type->Build(b), address_space, access);
}