mirror of
https://github.com/mii443/qemu.git
synced 2025-08-22 23:25:48 +00:00
decodetree: Properly diagnose fields overflowing an insn
Previously this would result in an exception for shifting the field mask by a negative number. Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
@ -622,6 +622,8 @@ def parse_generic(lineno, is_format, name, toks):
|
||||
sign = True
|
||||
flen = flen[1:]
|
||||
shift = int(flen, 10)
|
||||
if shift + width > insnwidth:
|
||||
error(lineno, 'field {0} exceeds insnwidth'.format(fname))
|
||||
f = Field(sign, insnwidth - width - shift, shift)
|
||||
flds = add_field(lineno, flds, fname, f)
|
||||
fixedbits <<= shift
|
||||
|
Reference in New Issue
Block a user