From 43d1609183014b8cfb6ae1cf4b1172d3b4fd5330 Mon Sep 17 00:00:00 2001 From: Alan Baker Date: Tue, 13 Mar 2018 12:02:29 -0400 Subject: [PATCH] Fixes #1407. Removing assertion against void pointer Added test --- source/opt/types.cpp | 4 +--- test/opt/types_test.cpp | 1 + 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/source/opt/types.cpp b/source/opt/types.cpp index b37c8be..01b6acc 100644 --- a/source/opt/types.cpp +++ b/source/opt/types.cpp @@ -487,9 +487,7 @@ void Opaque::GetExtraHashWords(std::vector* words) const { } Pointer::Pointer(Type* type, SpvStorageClass sc) - : Type(kPointer), pointee_type_(type), storage_class_(sc) { - assert(!type->AsVoid()); -} + : Type(kPointer), pointee_type_(type), storage_class_(sc) {} bool Pointer::IsSame(const Type* that) const { const Pointer* pt = that->AsPointer(); diff --git a/test/opt/types_test.cpp b/test/opt/types_test.cpp index c1156af..1f081d4 100644 --- a/test/opt/types_test.cpp +++ b/test/opt/types_test.cpp @@ -174,6 +174,7 @@ std::vector> GenerateAllTypes() { types.emplace_back(new Pointer(f32, SpvStorageClassInput)); types.emplace_back(new Pointer(sts32f32, SpvStorageClassFunction)); types.emplace_back(new Pointer(a42f32, SpvStorageClassFunction)); + types.emplace_back(new Pointer(voidt, SpvStorageClassFunction)); // Function types.emplace_back(new Function(voidt, {})); -- 2.7.4