From a5b9e96b39ce81e45d2861681b7354bb3c239b8e Mon Sep 17 00:00:00 2001 From: Ben Clayton Date: Mon, 13 Feb 2023 21:22:21 +0000 Subject: [PATCH] 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 Kokoro: Kokoro Reviewed-by: David Neto --- src/tint/reader/spirv/parser_type.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/tint/reader/spirv/parser_type.cc b/src/tint/reader/spirv/parser_type.cc index e1f2bbfe89..77b9df4d9f 100644 --- a/src/tint/reader/spirv/parser_type.cc +++ b/src/tint/reader/spirv/parser_type.cc @@ -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); }