Allow -2147483648 to count as a power of 2 in an optimization.

A case we oversought when implementing absorption of more than two flag tests into a single number.
This commit is contained in:
Sei Lisa 2017-10-18 00:04:35 +02:00
parent 2bee2db148
commit e8fb659592

View file

@ -379,7 +379,8 @@ class foldconst(object):
ch1 = child[a]['ch'][0]['ch'] ch1 = child[a]['ch'][0]['ch']
ch2 = child[b]['ch'][0]['ch'] ch2 = child[b]['ch'][0]['ch']
if (ch1[d]['nt'] == 'CONST' and ch2[f]['nt'] == 'CONST' if (ch1[d]['nt'] == 'CONST' and ch2[f]['nt'] == 'CONST'
and (ch2[f]['value'] & (ch2[f]['value'] - 1)) == 0 and (ch2[f]['value'] & (ch2[f]['value'] - 1)
& 0xFFFFFFFF) == 0
): ):
if self.CompareTrees(ch1[c], ch2[e]): if self.CompareTrees(ch1[c], ch2[e]):
# We're in that case. Apply optimization. # We're in that case. Apply optimization.