cert.py: more robust handling of values
This commit is contained in:
parent
2730b16326
commit
b5241ecb80
|
@ -194,7 +194,7 @@ def int31(data, platform):
|
||||||
if token.valueType.sign == 'unsigned':
|
if token.valueType.sign == 'unsigned':
|
||||||
found = False
|
found = False
|
||||||
for value in token.astOperand1.values:
|
for value in token.astOperand1.values:
|
||||||
if value.intvalue < 0:
|
if value.intvalue and value.intvalue < 0:
|
||||||
found = True
|
found = True
|
||||||
reportError(
|
reportError(
|
||||||
token,
|
token,
|
||||||
|
@ -215,7 +215,7 @@ def int31(data, platform):
|
||||||
minval = 0
|
minval = 0
|
||||||
maxval = ((1 << bits) - 1)
|
maxval = ((1 << bits) - 1)
|
||||||
for value in token.astOperand1.values:
|
for value in token.astOperand1.values:
|
||||||
if value.intvalue < minval or value.intvalue > maxval:
|
if value.intvalue and value.intvalue < minval or value.intvalue > maxval:
|
||||||
destType = ''
|
destType = ''
|
||||||
if token.valueType.sign:
|
if token.valueType.sign:
|
||||||
destType = token.valueType.sign + ' ' + token.valueType.type
|
destType = token.valueType.sign + ' ' + token.valueType.type
|
||||||
|
|
Loading…
Reference in New Issue