Commit b804abd6 authored by Danylo Piliaiev's avatar Danylo Piliaiev 🇺🇦 Committed by Marge Bot
Browse files

freedreno/isa: assert if field's range is out of bitset's range



Also, update outdated comment along the way.
Signed-off-by: Danylo Piliaiev's avatarDanylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <mesa/mesa!9628>
parent 42c81e19
......@@ -458,6 +458,12 @@ class ISA(object):
for field_name, field in case.fields.items():
if field.type == 'float':
assert field.get_size() == 32 or field.get_size() == 16
if not isinstance(field, BitSetDerivedField):
assert field.high < bitset.get_size(), \
"{}.{}: invalid bit range: [{}, {}] is not in [{}, {}]".format(
bitset_name, field_name, field.low, field.high, 0, bitset.get_size() - 1)
if field.type in builtin_types:
continue
if field.type in self.enums:
......@@ -481,4 +487,4 @@ class ISA(object):
# TODO we should probably be able to look at the contexts where
# an expression is evaluated and verify that it doesn't have any
# <var/> references that would be unresolved at evaluation time
\ No newline at end of file
# {VARNAME} references that would be unresolved at evaluation time
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment