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:
@@ -1041,7 +1041,7 @@ class foldconst(object):
|
|||||||
# we have {<<, something, {CONST n}}
|
# we have {<<, something, {CONST n}}
|
||||||
# we transform it into {*, something, {CONST n}}
|
# we transform it into {*, something, {CONST n}}
|
||||||
nt = node.nt = '*'
|
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
|
# Fall through to optimize product
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user