Don't fall through after optimizing a negable comparison, as it's folded already and the variables were incorrectly set and broke our invariants.
This commit is contained in:
@@ -769,9 +769,9 @@ class foldconst(object):
|
||||
# the number of cases to check.
|
||||
# a<=b --> !(a>b); a>=b --> !(a<b); a!=b --> !(a==b)
|
||||
node['nt'] = {'<=':'>', '>=':'<', '!=':'=='}[nt]
|
||||
node = parent[index] = {'nt':'!', 't':node['t'], 'ch':[node]}
|
||||
parent[index] = {'nt':'!', 't':node['t'], 'ch':[node]}
|
||||
self.FoldTree(parent, index)
|
||||
# Fall through to optimize as '<' or '>' or '=='
|
||||
return
|
||||
|
||||
if nt == '>':
|
||||
# Invert the inequalities to avoid doubling the cases to check.
|
||||
|
||||
Reference in New Issue
Block a user