[PATCH vkd3d 3/5] vkd3d-shader/hlsl: Do not try to dereference the else_instrs list pointer if there is no else block.

Giovanni Mascellani gmascellani at codeweavers.com
Tue Sep 21 04:04:49 CDT 2021


Signed-off-by: Giovanni Mascellani <gmascellani at codeweavers.com>

Il 20/09/21 23:40, Zebediah Figura ha scritto:
> Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
> ---
>   libs/vkd3d-shader/hlsl.y | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y
> index dc2d31044..20f88f915 100644
> --- a/libs/vkd3d-shader/hlsl.y
> +++ b/libs/vkd3d-shader/hlsl.y
> @@ -2694,7 +2694,8 @@ selection_statement:
>               if (!(instr = hlsl_new_if(ctx, condition, @1)))
>                   YYABORT;
>               list_move_tail(&instr->then_instrs, $5.then_instrs);
> -            list_move_tail(&instr->else_instrs, $5.else_instrs);
> +            if ($5.else_instrs)
> +                list_move_tail(&instr->else_instrs, $5.else_instrs);
>               vkd3d_free($5.then_instrs);
>               vkd3d_free($5.else_instrs);
>               if (condition->data_type->dimx > 1 || condition->data_type->dimy > 1)
> 



More information about the wine-devel mailing list