Module: vkd3d Branch: master Commit: b909a5fe0491b9221937ad214bda86ab4611634e URL: https://source.winehq.org/git/vkd3d.git/?a=commit;h=b909a5fe0491b9221937ad21...
Author: Józef Kucia jkucia@codeweavers.com Date: Fri Oct 26 15:06:52 2018 +0200
vkd3d-shader: Add asserts() to vkd3d_dxbc_compiler_emit_control_flow_instruction().
Signed-off-by: Józef Kucia jkucia@codeweavers.com Signed-off-by: Henri Verbeet hverbeet@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
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 f6e5746..f2ed8b8 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");