Zebediah Figura : vkd3d-shader/hlsl: Avoid crashing when emitting a dereference with non-constant offset.

Alexandre Julliard julliard at winehq.org
Fri Aug 27 14:57:56 CDT 2021


Module: vkd3d
Branch: master
Commit: ac88631755646d7e471056aa878cbba4a933727e
URL:    https://source.winehq.org/git/vkd3d.git/?a=commit;h=ac88631755646d7e471056aa878cbba4a933727e

Author: Zebediah Figura <zfigura at codeweavers.com>
Date:   Tue Aug 24 01:18:07 2021 -0500

vkd3d-shader/hlsl: Avoid crashing when emitting a dereference with non-constant offset.

Some places assert() that the register is allocated.

Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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 c2aeb7b..2759201 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;




More information about the wine-cvs mailing list