From 53d377c983aee3fb917f98cd4b7b14a555970310 Mon Sep 17 00:00:00 2001 From: Alan Baker Date: Tue, 14 Apr 2020 08:34:41 -0400 Subject: [PATCH] Remove implicit fallthrough 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 1c279f6549..1e33e51054 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: