[Mesa-dev] [PATCH 4/7] intel: decoder: move field name copy
Lionel Landwerlin
lionel.g.landwerlin at intel.com
Thu Aug 3 14:37:42 UTC 2017
This should be inside the function that actually decodes fields.
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
---
src/intel/common/gen_decoder.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/intel/common/gen_decoder.c b/src/intel/common/gen_decoder.c
index a30b7f28aab..9cd515b7f27 100644
--- a/src/intel/common/gen_decoder.c
+++ b/src/intel/common/gen_decoder.c
@@ -835,10 +835,6 @@ iter_advance_field(struct gen_field_iterator *iter)
}
iter->field = iter->field->next;
- if (iter->field->name)
- strncpy(iter->name, iter->field->name, sizeof(iter->name));
- else
- memset(iter->name, 0, sizeof(iter->name));
iter->dword = iter_group_offset_bits(iter, iter->group_iter) / 32 +
iter->field->start / 32;
iter->struct_desc = NULL;
@@ -857,6 +853,11 @@ gen_field_iterator_next(struct gen_field_iterator *iter)
if (!iter_advance_field(iter))
return false;
+ if (iter->field->name)
+ strncpy(iter->name, iter->field->name, sizeof(iter->name));
+ else
+ memset(iter->name, 0, sizeof(iter->name));
+
if ((iter->field->end - iter->field->start) > 32)
v.qw = ((uint64_t) iter->p[iter->dword+1] << 32) | iter->p[iter->dword];
else
--
2.13.3
More information about the mesa-dev
mailing list