No description
Find a file
Sei Lisa e62b5ffcb6 Fix exception when a global references another without constfold
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.
2022-10-31 18:42:19 +01:00
lslopt Fix exception when a global references another without constfold 2022-10-31 18:42:19 +01:00
pcpp@18d5bc4cdb Update to latest pcpp, remove expression evaluator 2020-11-04 13:09:34 +01:00
unit_tests Fix exception when a global references another without constfold 2022-10-31 18:42:19 +01:00
.gitignore Add the outfile.tmp file generated by a test to .gitignore 2019-01-15 23:22:02 +01:00
.gitmodules Don't report pcpp as modified if it has untracked files 2019-01-12 20:33:52 +01:00
builtins-unittest.txt Get rid of builtins.txt.dat by adding a parameter to the parser ctor. 2015-07-09 20:35:14 +02:00
builtins.txt New function, llSHA256String 2022-10-14 18:39:04 +02:00
COPYING Add copyright notices to all files, to prepare the program for release. 2015-03-05 23:18:41 +01:00
cpreproc.py Forgot to update copyright year 2022-06-07 19:46:31 +02:00
fndata.txt New function, llSHA256String 2022-10-14 18:39:04 +02:00
main.py Add pperrors variable to ease rebasing the preprocessor branch 2022-06-17 16:13:49 +02:00
README.md Update link to point to lsl.blacktulip-virtual.com instead of lsl.project.zone 2018-01-18 15:41:28 +01:00
run-tests.py Forgot to update copyright year 2022-06-07 19:46:31 +02:00
strutil.py Forgot to update copyright year 2022-06-07 19:46:31 +02:00

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/