From: Rafael Antognolli Date: Fri, 21 Apr 2017 22:11:17 +0000 (-0700) Subject: genxml: Fix gen_pack_header.py crash when field type is invalid. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6a40ccec4b232fc04edd9eb3c047f949e4422612;p=mesa.git 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 --- 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))