[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/3] decodetree: Allow !function with no input b
From: |
Richard Henderson |
Subject: |
Re: [Qemu-devel] [PATCH 1/3] decodetree: Allow !function with no input bits |
Date: |
Fri, 9 Aug 2019 08:57:47 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 |
On 8/9/19 8:52 AM, Peter Maydell wrote:
>> @@ -195,7 +195,10 @@ class MultiField:
>> """Class representing a compound instruction field"""
>> def __init__(self, subs, mask):
>> self.subs = subs
>> - self.sign = subs[0].sign
>> + if len(subs):
>> + self.sign = subs[0].sign
>> + else:
>> + self.sign = 0
>> self.mask = mask
>>
>> def __str__(self):
> Is this change to MultiField left over from the previous
> implementation ? I was expecting a zero-length MultiField
> to now be a bug in this python script (ie we should never
> try to create one).
>
Oops, yes.
The error is emitted here:
> + if len(subs) == 0:
> + if func:
> + f = ParameterField(func)
> + else:
> + error(lineno, 'field with no value')
and tested:
> +++ b/tests/decode/err_field6.decode
> @@ -0,0 +1,5 @@
> +# This work is licensed under the terms of the GNU LGPL, version 2 or later.
> +# See the COPYING.LIB file in the top-level directory.
> +
> +# Diagnose no bits in field
> +%field