From: Józef Kucia jkucia@codeweavers.com
Signed-off-by: Józef Kucia jkucia@codeweavers.com --- libs/vkd3d-shader/spirv.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index f6e5746084e1..f2ed8b888dbf 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -5287,6 +5287,8 @@ static void vkd3d_dxbc_compiler_emit_control_flow_instruction(struct vkd3d_dxbc_ { struct vkd3d_control_flow_info *breakable_cf_info;
+ assert(compiler->control_flow_depth); + if (!(breakable_cf_info = vkd3d_dxbc_compiler_find_innermost_breakable_cf_construct(compiler))) { FIXME("Unhandled break instruction.\n"); @@ -5311,6 +5313,8 @@ static void vkd3d_dxbc_compiler_emit_control_flow_instruction(struct vkd3d_dxbc_ { struct vkd3d_control_flow_info *loop_cf_info;
+ assert(compiler->control_flow_depth); + if (!(loop_cf_info = vkd3d_dxbc_compiler_find_innermost_loop(compiler))) { ERR("Invalid 'breakc' instruction outside loop.\n"); @@ -5327,6 +5331,8 @@ static void vkd3d_dxbc_compiler_emit_control_flow_instruction(struct vkd3d_dxbc_ { struct vkd3d_control_flow_info *loop_cf_info;
+ assert(compiler->control_flow_depth); + if (!(loop_cf_info = vkd3d_dxbc_compiler_find_innermost_loop(compiler))) { ERR("Invalid 'continue' instruction outside loop.\n");