From 2a2bdbd5d7215128641d5bfecfc535bb396ec1f4 Mon Sep 17 00:00:00 2001 From: alan-baker Date: Tue, 14 Apr 2020 12:57:48 -0400 Subject: [PATCH] Remove implicit fallthrough (#3298) Fixes #3296 * Make OpReturn its own case fully --- source/val/validate_cfg.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/val/validate_cfg.cpp b/source/val/validate_cfg.cpp index 1c279f654..1e33e5105 100644 --- a/source/val/validate_cfg.cpp +++ b/source/val/validate_cfg.cpp @@ -1090,8 +1090,9 @@ spv_result_t CfgPass(ValidationState_t& _, const Instruction* inst) { return _.diag(SPV_ERROR_INVALID_CFG, inst) << "OpReturn can only be called from a function with void " << "return type."; + _.current_function().RegisterBlockEnd(std::vector(), opcode); + break; } - // Fallthrough. case SpvOpKill: case SpvOpReturnValue: case SpvOpUnreachable: