mirror of
https://github.com/Sei-Lisa/LSL-PyOptimizer
synced 2025-07-01 15:48:21 +00:00
Get rid of StSw craziness and use lsllastpass to make another pass.
This has been a TODO item for long. Now that we have lsllastpass, it's actually easy to implement. Adds an LSLTypeDefaults dictionary to lslcommon, just in case the state-changing function returns a value and we need to insert a return statement. We've also added subtree-local info to lsllastpass (lost when we return to the parent after visiting a subtree). This fixes a bug where naked switch statements could appear as a result of optimization, and cause the compilation to fail.
This commit is contained in:
parent
e4eaab9e84
commit
a87022b73f
4 changed files with 77 additions and 29 deletions
|
@ -272,7 +272,7 @@ class Test03_Optimizer(UnitTestCase):
|
|||
vector vvvv2=vvvv;
|
||||
float ffff3 = v.z;
|
||||
integer fn(){
|
||||
if (1) state default; else return 2;
|
||||
if (1) state default;
|
||||
return fn();}
|
||||
|
||||
default{touch(integer n){
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue