mirror of
https://github.com/Sei-Lisa/LSL-PyOptimizer
synced 2025-07-01 23:58:20 +00:00
Fix llAbs corner case.
As an exception, llAbs(-2147483648) equals -2147483648.
This commit is contained in:
parent
3a91f04cb5
commit
7f8cb4ec58
2 changed files with 3 additions and 2 deletions
|
@ -821,7 +821,7 @@ def reduce(t):
|
||||||
|
|
||||||
def llAbs(i):
|
def llAbs(i):
|
||||||
assert isinteger(i)
|
assert isinteger(i)
|
||||||
return abs(i)
|
return abs(i) if i != -2147483648 else i
|
||||||
|
|
||||||
def llAcos(f):
|
def llAcos(f):
|
||||||
assert isfloat(f)
|
assert isfloat(f)
|
||||||
|
|
|
@ -1262,7 +1262,8 @@ def do_tests():
|
||||||
testB642S("FC83BFBFBFBF78", "%3Fx") # aliased range end (U+3FFFFFF)
|
testB642S("FC83BFBFBFBF78", "%3Fx") # aliased range end (U+3FFFFFF)
|
||||||
testB642S("FC848080808078", "%3F%3F%3F%3F%3F%3Fx") # U+4000000 (invalid 6-byte range start)
|
testB642S("FC848080808078", "%3F%3F%3F%3F%3F%3Fx") # U+4000000 (invalid 6-byte range start)
|
||||||
testB642S("FDBFBFBFBFBF78", "%3F%3F%3F%3F%3F%3Fx") # U+7FFFFFFF (invalid 6-byte range end)
|
testB642S("FDBFBFBFBFBF78", "%3F%3F%3F%3F%3F%3Fx") # U+7FFFFFFF (invalid 6-byte range end)
|
||||||
# not actually valid either way (these are actually used to distinguish the input as UTF-16 BOM)
|
# not actually valid either way (these are actually used to distinguish the
|
||||||
|
# input as UTF-16 BOM and are invalid in UTF-8)
|
||||||
testB642S("FEB080808080808078", "%3F%3F%3F%3F%3F%3F%3F%3Fx")
|
testB642S("FEB080808080808078", "%3F%3F%3F%3F%3F%3F%3F%3Fx")
|
||||||
testB642S("FFBFBFBFBFBFBFBF78", "%3F%3F%3F%3F%3F%3F%3F%3Fx")
|
testB642S("FFBFBFBFBFBFBFBF78", "%3F%3F%3F%3F%3F%3F%3F%3Fx")
|
||||||
# short or invalid sequences
|
# short or invalid sequences
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue