[Mesa-dev] [PATCH 2/3] r600: fix off-by-one in egd_tables.py

Nicolai Hähnle nhaehnle at gmail.com
Mon Jun 12 19:33:06 UTC 2017


From: Nicolai Hähnle <nicolai.haehnle at amd.com>

Port of the corresponding fix in sid_tables.py.
---
 src/gallium/drivers/r600/egd_tables.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/drivers/r600/egd_tables.py b/src/gallium/drivers/r600/egd_tables.py
index 4c60602..d7b78c7 100644
--- a/src/gallium/drivers/r600/egd_tables.py
+++ b/src/gallium/drivers/r600/egd_tables.py
@@ -103,21 +103,21 @@ class IntTable:
         self.table += array
         self.idxs.add(idx)
         return idx
 
     def emit(self, filp, name, static=True):
         """
         Write
         [static] const typename name[] = { ... };
         to filp.
         """
-        idxs = sorted(self.idxs) + [-1]
+        idxs = sorted(self.idxs) + [len(self.table)]
 
         fragments = [
             ('\t/* %s */ %s' % (
                 idxs[i],
                 ' '.join((str(elt) + ',') for elt in self.table[idxs[i]:idxs[i+1]])
             ))
             for i in range(len(idxs) - 1)
         ]
 
         filp.write('%sconst %s %s[] = {\n%s\n};\n' % (
-- 
2.9.3



More information about the mesa-dev mailing list