Logo
Explore Help
Register Sign In
Miko/LSL-PyOptimizer
1
0
Fork 0
You've already forked LSL-PyOptimizer
Code Issues Pull Requests Actions Packages Projects Releases Wiki Activity
Files
8d4750b6d0decf4bdcaeb4dd835ddef84d934b5d
LSL-PyOptimizer/unit_tests/regression.suite/issue-19.run

2 lines
27 B
Plaintext
Raw Normal View History

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:23:00 +01:00
main.py -y -O -constfold -
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.25.3 Page: 39ms Template: 2ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API