mirror of
https://github.com/Sei-Lisa/LSL-PyOptimizer
synced 2025-07-01 23:58:20 +00:00
Fix deletion of if (SEF_expr) ;
Fixes #29. Thanks @KrsityKu for the test case, which was added to the test suite.
This commit is contained in:
parent
ff85a1e837
commit
1e1f181b82
3 changed files with 20 additions and 1 deletions
|
@ -1819,7 +1819,7 @@ class foldconst(object):
|
|||
# if (X) ; -> X;
|
||||
if len(child) == 2:
|
||||
parent[index] = nr(nt='EXPR', t=child[0].t,
|
||||
ch=[child[0]])
|
||||
ch=[child[0]], SEF=child[0].SEF)
|
||||
# It has been promoted to statement. Fold it as such.
|
||||
# (Will remove it if SEF)
|
||||
self.FoldStmt(parent, index)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue