From 6a40ccec4b232fc04edd9eb3c047f949e4422612 Mon Sep 17 00:00:00 2001 From: Rafael Antognolli Date: Fri, 21 Apr 2017 15:11:17 -0700 Subject: [PATCH] genxml: Fix gen_pack_header.py crash when field type is invalid. Just return earlier in that case. Also set prefix to an empty string, so we don't get to use it undefined. Signed-off-by: Rafael Antognolli Reviewed-by: Kenneth Graunke --- src/intel/genxml/gen_pack_header.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/intel/genxml/gen_pack_header.py b/src/intel/genxml/gen_pack_header.py index 1b1949ff8a5..020dbe40a60 100644 --- a/src/intel/genxml/gen_pack_header.py +++ b/src/intel/genxml/gen_pack_header.py @@ -273,14 +273,14 @@ class Field(object): return else: print("#error unhandled type: %s" % self.type) + return print(" %-36s %s%s;" % (type, self.name, dim)) + prefix = "" if len(self.values) > 0 and self.default == None: if self.prefix: prefix = self.prefix + "_" - else: - prefix = "" for value in self.values: print("#define %-40s %d" % (prefix + value.name, value.value)) -- 2.30.2