Giovanni Mascellani (@giomasce) commented about libs/vkd3d-shader/hlsl.y:
- return false;
+}
+static struct list *create_loop(struct hlsl_ctx *ctx, enum loop_type type, const struct parse_attribute_list *attributes,
struct list *init, struct list *cond, struct list *iter, struct list *body, struct vkd3d_shader_location loc)
{ struct list *list = NULL; struct hlsl_ir_loop *loop = NULL; struct hlsl_ir_if *cond_jump = NULL;
- unsigned int i;
- if (attribute_list_has_duplicates(attributes))
- {
hlsl_error(ctx, &loc, VKD3D_SHADER_ERROR_HLSL_INVALID_SYNTAX, "Found duplicate attribute.");
return NULL;
- }
Please add a test that triggers this. The only `for` test we currently have fails for other reasons (`break` and `continue` are unsupported), so it's not a good indicator here, it's better to create another one that otherwise succeeds (both for the single and duplicated attribute). That will trigger a segmentation fault, which should be fixed. I believe the segmentation fault is caused by `create_loop()` returning `NULL` instead of an empty list on errors, which means that it's not (entirely) your commit's fault, but please fix it anyway.