From 14e9a1ba1c6b8403e3df5522ae763aed5a8f1f45 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Thu, 23 Sep 2021 16:47:02 -0500 Subject: [PATCH] vkd3d-shader/hlsl: Don't dereference a NULL offset_node in hlsl_offset_from_deref(). Signed-off-by: Zebediah Figura Signed-off-by: Henri Verbeet Signed-off-by: Giovanni Mascellani Signed-off-by: Matteo Bruni Signed-off-by: Alexandre Julliard --- libs/vkd3d-shader/hlsl_codegen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/vkd3d-shader/hlsl_codegen.c b/libs/vkd3d-shader/hlsl_codegen.c index 9efc3dad..6f8bece9 100644 --- a/libs/vkd3d-shader/hlsl_codegen.c +++ b/libs/vkd3d-shader/hlsl_codegen.c @@ -1201,7 +1201,7 @@ unsigned int hlsl_offset_from_deref(const struct hlsl_deref *deref) if (offset_node->type != HLSL_IR_CONSTANT) { FIXME("Dereference with non-constant offset of type %s.\n", hlsl_node_type_to_string(offset_node->type)); - offset_node = NULL; + return 0; } return hlsl_ir_constant(offset_node)->value[0].u;