mirror of
https://github.com/Sei-Lisa/LSL-PyOptimizer
synced 2024-11-21 14:18:57 -07:00
No description
e62b5ffcb6
Fixes #19. Thanks to SaladDais for the report and test case. With constant folding inactive, the dead code removal optimization was removing globals and their symbols when they were e.g. integer constants, without substituting them in other globals. This produced a crash when the output module tried to access said symbols. For example, in this code: ``` integer A = 1; integer B = A; default{timer(){llBreakLink(B);}} ``` the line `integer A = 1` was being removed, as well as the `A` global symbol, but the line `integer B = A` was retained with the missing symbol, and the output module crashed when trying to look up the `A` symbol. Apparently, it wasn't an issue when constant folding was active (which is why it went unnoticed for so long) because the constant folding code sets 'orig' in the symbol table to the original value the variable was being set to, which let the output module know what to output. The fix is to replace the references to deleted symbols with their values in global definitions. In normal code that was already happening. |
||
---|---|---|
lslopt | ||
pcpp@18d5bc4cdb | ||
unit_tests | ||
.gitignore | ||
.gitmodules | ||
builtins-unittest.txt | ||
builtins.txt | ||
COPYING | ||
cpreproc.py | ||
fndata.txt | ||
main.py | ||
README.md | ||
run-tests.py | ||
strutil.py |
LSL PyOptimizer
LSL PyOptimizer is a LSL2 script optimizer written in Python 2. Currently it only supports code memory optimization (no speed optimization), only for Mono (no LSO), and only for the Second Life flavour of LSL (no OpenSim etc.).
HTML introduction, list of features and documentation available at http://lsl.blacktulip-virtual.com/lsl-pyoptimizer/