mirror of
https://github.com/Sei-Lisa/LSL-PyOptimizer
synced 2025-07-01 15:48:21 +00:00
Fix functions with side effects being erroneously optimized.
The function's SEF status was not taken into account when substituting functions with their values. This affected llModPow and llXorBase64Strings, both of which have a delay, and were erroneously substituted. But allow them to be substituted when in calculator mode.
This commit is contained in:
parent
8b9fe7693e
commit
3afd961cf7
1 changed files with 3 additions and 2 deletions
|
@ -946,8 +946,9 @@ class foldconst(object):
|
|||
|
||||
sym = self.symtab[0][node['name']]
|
||||
OptimizeParams(node, sym)
|
||||
if 'Fn' in sym:
|
||||
# Guaranteed to be side-effect free if the children are.
|
||||
if 'Fn' in sym and ('SEF' in sym and sym['SEF'] or lslcommon.IsCalc):
|
||||
# It's side-effect free if the children are and the function
|
||||
# is marked as SEF.
|
||||
if SEFargs:
|
||||
node['SEF'] = True
|
||||
if CONSTargs:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue