From b67a68b486fc47cff3fb11a634fbb67da1ffab0b Mon Sep 17 00:00:00 2001 From: Conor McCarthy Date: Sat, 27 Apr 2024 00:12:54 +1000 Subject: [PATCH] vkd3d-shader/dxil: Emit an error if a ATOMICRMW instruction uses a forward-referenced pointer. --- libs/vkd3d-shader/dxil.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/vkd3d-shader/dxil.c b/libs/vkd3d-shader/dxil.c index 99227d80..5bb05058 100644 --- a/libs/vkd3d-shader/dxil.c +++ b/libs/vkd3d-shader/dxil.c @@ -3961,7 +3961,8 @@ static void sm6_parser_emit_atomicrmw(struct sm6_parser *sm6, const struct dxil_ uint64_t code; if (!(ptr = sm6_parser_get_value_by_ref(sm6, record, NULL, &i)) - || !sm6_value_validate_is_pointer_to_i32(ptr, sm6)) + || !sm6_value_validate_is_pointer_to_i32(ptr, sm6) + || !sm6_value_validate_is_backward_ref(ptr, sm6)) return; if (ptr->u.reg.type != VKD3DSPR_GROUPSHAREDMEM)