mirror of
https://github.com/Sei-Lisa/LSL-PyOptimizer
synced 2025-07-01 23:58:20 +00:00
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:
parent
d58bc2d350
commit
4302ea846d
1 changed files with 2 additions and 2 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue