mirror of
https://github.com/Sei-Lisa/LSL-PyOptimizer
synced 2025-07-01 23:58:20 +00:00
Fix "Value of unknown type" on bit shift optimization
When converting x << constant to a product, we neglected to truncate the converted constant to S32. Per bug report by Tonaie Resident.
This commit is contained in:
parent
21cecc46f8
commit
960cbfaa09
1 changed files with 1 additions and 1 deletions
|
@ -1041,7 +1041,7 @@ class foldconst(object):
|
|||
# we have {<<, something, {CONST n}}
|
||||
# we transform it into {*, something, {CONST n}}
|
||||
nt = node.nt = '*'
|
||||
child[1].value = 1 << (child[1].value & 31)
|
||||
child[1].value = lslfuncs.S32(1 << (child[1].value & 31))
|
||||
|
||||
# Fall through to optimize product
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue