diff options
Diffstat (limited to 'src/intel/common/gen_decoder.c')
-rw-r--r-- | src/intel/common/gen_decoder.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/intel/common/gen_decoder.c b/src/intel/common/gen_decoder.c index ac7c94f41e6..d2190cb8b1f 100644 --- a/src/intel/common/gen_decoder.c +++ b/src/intel/common/gen_decoder.c @@ -850,9 +850,13 @@ gen_field_decode(struct gen_field_iterator *iter) 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 + memset(&v, 0, sizeof(v)); + + if ((iter->field->end - iter->field->start) > 32) { + if (&iter->p[iter->dword + 1] < iter->p_end) + v.qw = ((uint64_t) iter->p[iter->dword+1] << 32); + v.qw |= iter->p[iter->dword]; + } else v.qw = iter->p[iter->dword]; const char *enum_name = NULL; @@ -941,6 +945,7 @@ gen_field_iterator_init(struct gen_field_iterator *iter, else iter->field = group->next->fields; iter->p = p; + iter->p_end = &p[gen_group_get_length(iter->group, iter->p)]; iter->print_colors = print_colors; gen_field_decode(iter); |