From bc4cb1b3c54464a9313c9ba52fc96e00dd231b59 Mon Sep 17 00:00:00 2001 From: Hans-Kristian Arntzen Date: Mon, 8 Mar 2021 10:39:59 +0100 Subject: [PATCH] Throw if SPIR-V module has no entry points. --- spirv_parser.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spirv_parser.cpp b/spirv_parser.cpp index 7159a325..86f7fd35 100644 --- a/spirv_parser.cpp +++ b/spirv_parser.cpp @@ -140,6 +140,8 @@ void Parser::parse() SPIRV_CROSS_THROW("Function was not terminated."); if (current_block) SPIRV_CROSS_THROW("Block was not terminated."); + if (ir.default_entry_point == 0) + SPIRV_CROSS_THROW("There is no entry point in the SPIR-V module."); } const uint32_t *Parser::stream(const Instruction &instr) const