In the array-of-struct case, recursion() takes the row_major flag for
each iteration from 't->fields.structure[i]', but 't' is not a record
type. Inherit the array declaration row_major flag instead.
This mistake was found by running piglit on valgrind.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=69449
Cc: "9.1 9.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Kenneth Graunke <kenneth@whitecape.org>
/* Append the subscript to the current variable name */
ralloc_asprintf_rewrite_tail(name, &new_length, "[%u]", i);
- recursion(t->fields.array, name, new_length,
- t->fields.structure[i].row_major, record_type);
+ recursion(t->fields.array, name, new_length, row_major,
+ record_type);
/* Only the first leaf-field of the record gets called with the
* record type pointer.