LSL-PyOptimizer/lslopt
Sei Lisa aad4cf3bee Fix the fix for the bug introduced in 097c054
Our previous fix was incomplete, because it failed to detect the last IF in a chain of ELSE IFs. For example:

if (a == 2) llDie(); else if (a) llDie(); else if (a == 3) llDie();

That would be transformed by the IF swapper into:

if (a ^ 2)
    if (a)
        llDie();
    else if (a == 3)
        llDie();
else
    llDie();

Note that the last 'else' would bind to the last 'if', not to the first one. So the condition is actually like this:

child[1] of an 'if' statement needs to be guarded in {} if the 'else' may belong to the wrong 'if'.

It will belong to the wrong 'if' if child[1] is a (possibly empty) chain of 'if {whatever} else ...', followed by an 'if' without 'else', that is:

   if (cond) stmt;

(which was what our previous check did), but also e.g.:

   if (cond) stmt; else if (cond) stmt; else if (cond) stmt;

which we neglected to consider in our previous fix.
2017-12-14 21:32:00 +01:00
..
__init__.py Initial commit. Status so far: 2014-07-26 02:43:44 +02:00
lslbasefuncs.py Fix compare and llListSort for LSO. 2017-10-21 12:32:41 +02:00
lslcommon.py Get rid of StSw craziness and use lsllastpass to make another pass. 2017-11-02 18:20:14 +01:00
lsldeadcode.py Remove "magic names" where possible, using new data from fndata.txt 2017-10-27 23:39:26 +02:00
lslextrafuncs.py Remove "magic names" where possible, using new data from fndata.txt 2017-10-27 23:39:26 +02:00
lslfoldconst.py Fix bug with nested if's; fix missing EXPR wrap. 2017-11-13 04:04:13 +01:00
lslfuncopt.py Comment fix. 2017-10-20 10:18:44 +02:00
lslfuncs.py Bump copyright year. 2017-08-09 19:45:46 +02:00
lsljson.py Change strategy for the checking of function input types. 2017-10-12 17:16:16 +02:00
lsllastpass.py Collect used library functions as reusable names for the renamer. 2017-11-02 23:19:33 +01:00
lslloadlib.py Implement flags aimed at removing "magic names" in the code. 2017-10-27 18:49:58 +02:00
lsloptimizer.py Collect used library functions as reusable names for the renamer. 2017-11-02 23:19:33 +01:00
lsloutput.py Fix the fix for the bug introduced in 097c054 2017-12-14 21:32:00 +01:00
lslparse.py Add --prettify option, to reformat a script (losing comments). 2017-11-20 20:59:45 +01:00
lslrenamer.py Collect used library functions as reusable names for the renamer. 2017-11-02 23:19:33 +01:00