LSL-PyOptimizer/lslopt
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
..
__init__.py Initial commit. Status so far: 2014-07-26 02:43:44 +02:00
lslbasefuncs.py New function, llSHA256String 2022-10-14 18:39:04 +02:00
lslcommon.py Forgot to update copyright year 2022-06-07 19:46:31 +02:00
lsldeadcode.py Fix exception when a global references another without constfold 2022-10-31 18:42:19 +01:00
lslextrafuncs.py New upstream function: llGetObjectLinkKey 2022-10-01 01:18:12 +02:00
lslfoldconst.py Forgot to update copyright year 2022-06-07 19:46:31 +02:00
lslfuncopt.py Forgot to update copyright year 2022-06-07 19:46:31 +02:00
lslfuncs.py Forgot to update copyright year 2022-06-07 19:46:31 +02:00
lslinliner.py Forgot to update copyright year 2022-06-07 19:46:31 +02:00
lsljson.py Forgot to update copyright year 2022-06-07 19:46:31 +02:00
lsllastpass.py Forgot to update copyright year 2022-06-07 19:46:31 +02:00
lslloadlib.py Forgot to update copyright year 2022-06-07 19:46:31 +02:00
lsloptimizer.py Forgot to update copyright year 2022-06-07 19:46:31 +02:00
lsloutput.py Forgot to update copyright year 2022-06-07 19:46:31 +02:00
lslparse.py The grammar comment for simple_expr_except_list was missing IDENT 2022-10-31 17:20:25 +01:00
lslrenamer.py Forgot to update copyright year 2022-06-07 19:46:31 +02:00