ac/debug: Decrease num_dw for type 2 NOP's.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Sun, 15 Jan 2017 22:01:03 +0000 (23:01 +0100)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Tue, 17 Jan 2017 19:54:57 +0000 (20:54 +0100)
Otherwise we read past the end of the buffer.

Signed-off-by: Bas Nieuwenhuizen <basni@google.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/amd/common/ac_debug.c

index f91e448a47f28cfe4690cd7a170e1f7861ec276d..989dfda4ff9c97863a1e6cc1f038264c6aec0cbf 100644 (file)
@@ -357,6 +357,7 @@ void ac_parse_ib(FILE *f, uint32_t *ib, int num_dw, int trace_id,
                        if (ib[0] == 0x80000000) {
                                fprintf(f, COLOR_GREEN "NOP (type 2)" COLOR_RESET "\n");
                                ib++;
+                               num_dw--;
                                break;
                        }
                        /* fall through */