From 776029fb717075295928342b911bf5ed68f5f5a2 Mon Sep 17 00:00:00 2001 From: Dejan Mircevski Date: Fri, 22 Apr 2016 14:56:07 -0400 Subject: [PATCH] Make grammar-generation fail if over 64 capabilities. --- utils/generate_grammar_tables.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/utils/generate_grammar_tables.py b/utils/generate_grammar_tables.py index b311a668e..3c0b05e89 100755 --- a/utils/generate_grammar_tables.py +++ b/utils/generate_grammar_tables.py @@ -37,6 +37,12 @@ def populate_capability_bit_mapping_dict(cap_dict): assert cap_dict['category'] == 'ValueEnum' assert cap_dict['kind'] == 'Capability' for enumerant in cap_dict['enumerants']: + if enumerant['value'] > 63: + print( + "error: capability enumerant {} valued {} is over 63; " + "spv_capability_mask_t doesn't support this".format( + enumerant['enumerant'], enumerant['value'])) + exit(1) CAPABILITY_BIT_MAPPING[enumerant['enumerant']] = enumerant['value']