diff options
| author | Richard Henderson | 2019-03-06 00:34:41 +0100 |
|---|---|---|
| committer | Richard Henderson | 2019-03-12 17:46:58 +0100 |
| commit | 2decfc95583dc28add69810eaca6ada7b4b44d3a (patch) | |
| tree | 718b5b36ee3787742d9c30f344922f2bc802ae44 /scripts | |
| parent | decodetree: Prefix extract function names with decode_function (diff) | |
| download | qemu-2decfc95583dc28add69810eaca6ada7b4b44d3a.tar.gz qemu-2decfc95583dc28add69810eaca6ada7b4b44d3a.tar.xz qemu-2decfc95583dc28add69810eaca6ada7b4b44d3a.zip | |
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>
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/decodetree.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/scripts/decodetree.py b/scripts/decodetree.py index ac158b42d0..aa790b596a 100755 --- a/scripts/decodetree.py +++ b/scripts/decodetree.py @@ -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 |
