diff options
author | Rafael Antognolli <[email protected]> | 2017-04-21 15:11:17 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2017-04-24 15:14:12 -0700 |
commit | 6a40ccec4b232fc04edd9eb3c047f949e4422612 (patch) | |
tree | a3b19cb619d9f2d055092313d53d04b12999f298 /src/intel/genxml | |
parent | 9670124e3157636e5325fc0d3302375709403d0e (diff) |
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 <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/intel/genxml')
-rw-r--r-- | src/intel/genxml/gen_pack_header.py | 4 |
1 files 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)) |