mirror of
https://github.com/Sei-Lisa/LSL-PyOptimizer
synced 2025-06-30 23:28:20 +00:00
Fix non-compliance problem with octal/hex literals without U suffix
To follow the standard, hexadecimal and octal values that don't fit an intmax_t must be of type uintmax_t, regardless of the presence of the U suffix.
This commit is contained in:
parent
dc41b36ace
commit
326091624c
1 changed files with 4 additions and 1 deletions
|
@ -317,7 +317,10 @@ class Evaluator(object):
|
|||
raise EvalError("Invalid integer literal")
|
||||
val = (int(m.group(2), 8) if m.group(2)
|
||||
else int(m.group(1) or m.group(3), 0))
|
||||
val = self.to_uint(val) if m.group(4) else self.to_sint(val)
|
||||
val = (self.to_uint(val)
|
||||
if m.group(4)
|
||||
or val >= -INTMAX_MIN and m.group(3) is None
|
||||
else self.to_sint(val))
|
||||
return val
|
||||
|
||||
if tok.type == 'CPP_STRING':
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue