mirror of
https://github.com/Sei-Lisa/LSL-PyOptimizer
synced 2025-07-01 23:58:20 +00:00
Fix problem due to not copying a node. It still needs more analysis, but this patch is an improvement in that it fixes known problematic cases and doesn't seem to introduce new ones.
This commit is contained in:
parent
aaa8d3b7f4
commit
cdc3a63179
1 changed files with 12 additions and 4 deletions
|
@ -411,12 +411,20 @@ class deadcode(object):
|
||||||
sym = self.SymbolReplacedOrDeleted(node)
|
sym = self.SymbolReplacedOrDeleted(node)
|
||||||
if sym:
|
if sym:
|
||||||
# Mark as executed, so it isn't optimized out.
|
# Mark as executed, so it isn't optimized out.
|
||||||
new = sym['W']
|
# Make shallow copy.
|
||||||
|
# TODO: Needs more analysis to see if it's correct or not.
|
||||||
|
# (See constant_anomaly.lsl)
|
||||||
|
new = sym['W'].copy()
|
||||||
|
if 'orig' in new:
|
||||||
|
del new['orig']
|
||||||
|
|
||||||
new['X'] = True
|
new['X'] = True
|
||||||
|
|
||||||
SEF = 'SEF' in sym['W']
|
# this part makes no sense?
|
||||||
if SEF:
|
#SEF = 'SEF' in sym['W']
|
||||||
new['SEF'] = True
|
#if SEF:
|
||||||
|
# new['SEF'] = True
|
||||||
|
|
||||||
if new['t'] != node['t']:
|
if new['t'] != node['t']:
|
||||||
new = self.Cast(new, node['t'])
|
new = self.Cast(new, node['t'])
|
||||||
curnode['ch'][index] = node = new
|
curnode['ch'][index] = node = new
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue