[PATCH vkd3d 1/6] vkd3d-shader/hlsl: Avoid crashing when emitting a dereference with non-constant offset.

Zebediah Figura zfigura at codeweavers.com
Tue Aug 24 01:18:07 CDT 2021


Some places assert() that the register is allocated.

Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
---
 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 c2aeb7b0..27592015 100644
--- a/libs/vkd3d-shader/hlsl_codegen.c
+++ b/libs/vkd3d-shader/hlsl_codegen.c
@@ -1200,7 +1200,7 @@ struct hlsl_reg hlsl_reg_from_deref(const struct hlsl_deref *deref, const struct
     if (offset_node && offset_node->type != HLSL_IR_CONSTANT)
     {
         FIXME("Dereference with non-constant offset of type %s.\n", hlsl_node_type_to_string(offset_node->type));
-        return ret;
+        offset_node = NULL;
     }
 
     ret = var->reg;
-- 
2.32.0




More information about the wine-devel mailing list