[Mesa-dev] [PATCH 1/2] genxml: Fix python crash when no dwords are found.
Rafael Antognolli
rafael.antognolli at intel.com
Fri Apr 7 16:52:16 UTC 2017
If the 'dwords' dict is empty, max(dwords.keys()) throws an exception.
This case could happen when we have an instruction that is only an array
of other structs, with variable length.
Signed-off-by: Rafael Antognolli <rafael.antognolli at intel.com>
---
src/intel/genxml/gen_pack_header.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/intel/genxml/gen_pack_header.py b/src/intel/genxml/gen_pack_header.py
index 2a70945..95215a1 100644
--- a/src/intel/genxml/gen_pack_header.py
+++ b/src/intel/genxml/gen_pack_header.py
@@ -357,7 +357,7 @@ class Group(object):
if self.size > 0:
length = self.size // 32
else:
- length = max(dwords.keys()) + 1
+ length = max(dwords.keys() + [0]) + 1
for index in range(length):
# Handle MBZ dwords
base-commit: 115e6847920bfe4e2f2d542d947212a2aeae5db7
--
git-series 0.9.1
More information about the mesa-dev
mailing list