summaryrefslogtreecommitdiffstats
path: root/src/intel/tools
diff options
context:
space:
mode:
Diffstat (limited to 'src/intel/tools')
-rw-r--r--src/intel/tools/aubinator.c7
-rw-r--r--src/intel/tools/aubinator_error_decode.c7
2 files changed, 8 insertions, 6 deletions
diff --git a/src/intel/tools/aubinator.c b/src/intel/tools/aubinator.c
index cae578babac..05d932ea6c7 100644
--- a/src/intel/tools/aubinator.c
+++ b/src/intel/tools/aubinator.c
@@ -682,17 +682,18 @@ static void
parse_commands(struct gen_spec *spec, uint32_t *cmds, int size, int engine)
{
uint32_t *p, *end = cmds + size / 4;
- unsigned int length, i;
+ int length, i;
struct gen_group *inst;
for (p = cmds; p < end; p += length) {
inst = gen_spec_find_instruction(spec, p);
+ length = gen_group_get_length(inst, p);
+ assert(inst == NULL || length > 0);
+ length = MAX2(1, length);
if (inst == NULL) {
fprintf(outfile, "unknown instruction %08x\n", p[0]);
- length = (p[0] & 0xff) + 2;
continue;
}
- length = gen_group_get_length(inst, p);
const char *color, *reset_color = NORMAL;
uint64_t offset;
diff --git a/src/intel/tools/aubinator_error_decode.c b/src/intel/tools/aubinator_error_decode.c
index 1bdab00a663..2e623698ed1 100644
--- a/src/intel/tools/aubinator_error_decode.c
+++ b/src/intel/tools/aubinator_error_decode.c
@@ -217,7 +217,7 @@ static void decode(struct gen_spec *spec,
int *count)
{
uint32_t *p, *end = (data + *count);
- unsigned int length;
+ int length;
struct gen_group *inst;
for (p = data; p < end; p += length) {
@@ -226,9 +226,11 @@ static void decode(struct gen_spec *spec,
uint64_t offset = gtt_offset + 4 * (p - data);
inst = gen_spec_find_instruction(spec, p);
+ length = gen_group_get_length(inst, p);
+ assert(inst == NULL || length > 0);
+ length = MAX2(1, length);
if (inst == NULL) {
printf("unknown instruction %08x\n", p[0]);
- length = (p[0] & 0xff) + 2;
continue;
}
if (option_color == COLOR_NEVER) {
@@ -241,7 +243,6 @@ static void decode(struct gen_spec *spec,
gen_print_group(stdout, inst, offset, p,
option_color == COLOR_ALWAYS);
- length = gen_group_get_length(inst, p);
}
}