[Mesa-dev] [PATCH 09/22] intel/compiler: fix for memmove argument on annotating error

kevin.rogovin at intel.com kevin.rogovin at intel.com
Mon Sep 25 10:34:09 UTC 2017


From: Kevin Rogovin <kevin.rogovin at intel.com>

Without this fix, disassembling of GEN shaders with GPU commands
that the disassembler does not know would result in errors being
added to the annotator which would crash when more than one error
was added.

Signed-off-by: Kevin Rogovin <kevin.rogovin at intel.com>
---
 src/intel/compiler/intel_asm_annotation.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/intel/compiler/intel_asm_annotation.c b/src/intel/compiler/intel_asm_annotation.c
index b07a545..7aa222f 100644
--- a/src/intel/compiler/intel_asm_annotation.c
+++ b/src/intel/compiler/intel_asm_annotation.c
@@ -181,8 +181,9 @@ annotation_insert_error(struct annotation_info *annotation, unsigned offset,
          continue;
 
       if (offset + sizeof(brw_inst) != next->offset) {
-         memmove(next, cur,
-                 (annotation->ann_count - i + 2) * sizeof(struct annotation));
+         int count;
+         count = annotation->ann_count - i - 1;
+         memmove(next, cur, count * sizeof(struct annotation));
          cur->error = NULL;
          cur->error_length = 0;
          cur->block_end = NULL;
-- 
2.7.4



More information about the mesa-dev mailing list