Mesa (master): ac/debug: Decrease num_dw for type 2 NOP's.

Bas Nieuwenhuizen bnieuwenhuizen at kemper.freedesktop.org
Tue Jan 17 19:58:16 UTC 2017


Module: Mesa
Branch: master
Commit: 3b4bf8aa636768f4ad5fb636b8406e58d0d78f62
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=3b4bf8aa636768f4ad5fb636b8406e58d0d78f62

Author: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Date:   Sun Jan 15 23:01:03 2017 +0100

ac/debug: Decrease num_dw for type 2 NOP's.

Otherwise we read past the end of the buffer.

Signed-off-by: Bas Nieuwenhuizen <basni at google.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com>

---

 src/amd/common/ac_debug.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/amd/common/ac_debug.c b/src/amd/common/ac_debug.c
index f91e448..989dfda 100644
--- a/src/amd/common/ac_debug.c
+++ b/src/amd/common/ac_debug.c
@@ -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 */




More information about the mesa-commit mailing list