On 05-07-22 05:22, Giovanni Mascellani wrote:
+ dst_field->loc = src_field->loc; + dst_field->type = hlsl_type_clone(ctx, src_field->type, default_majority, modifiers);
This is happening also before the patch and in the array branch, but shouldn't we detect if hlsl_type_clone() returns NULL and handle the error? It's true that the memory error is set anyway, so the compilation will eventually fail, but in the meantime dst_file->type is NULL, and some other code ran during parsing could trip on that.
Giovanni.
Hmm, yes, looking at the implementation of hlsl_type_clone() it makes sense to handle the possibility of recursive calls returning NULL.
Given that we also have to fix the HLSL_CLASS_ARRAY branch, I will introduce a little new patch to fix these problems; just after this one.
Best regards, Francisco.