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: