diff --git a/lslopt/lsldeadcode.py b/lslopt/lsldeadcode.py index 728c17a..59cf2fa 100644 --- a/lslopt/lsldeadcode.py +++ b/lslopt/lsldeadcode.py @@ -322,13 +322,18 @@ class deadcode(object): node = sym['W'] nt = node.nt - while nt == 'IDENT': - # Follow the chain of identifiers all the way to the original - if self.symtab[node.scope][node.name].get('W', False) is False: - return sym - sym = self.symtab[node.scope][node.name] - node = sym['W'] - nt = node.nt + # This screws up swaps. See + # unit_tests/regression.suite/aggressive-local-removal.lsl + # It can't be done without a reliable CFG-based method (SSA or + # the like). + +# while nt == 'IDENT': +# # Follow the chain of identifiers all the way to the original +# if self.symtab[node.scope][node.name].get('W', False) is False: +# return sym +# sym = self.symtab[node.scope][node.name] +# node = sym['W'] +# nt = node.nt if nt == 'CONST': tcurnode = curnode.t diff --git a/unit_tests/coverage.suite/inline-4.out b/unit_tests/coverage.suite/inline-4.out index 52d485c..6e9a45b 100644 --- a/unit_tests/coverage.suite/inline-4.out +++ b/unit_tests/coverage.suite/inline-4.out @@ -17,8 +17,9 @@ default { { { + integer f2param = 4; { - llOwnerSay("f2:" + "4"); + llOwnerSay("f2:" + (string)f2param); } } { diff --git a/unit_tests/regression.suite/declaration-chain-dcr.out b/unit_tests/regression.suite/declaration-chain-dcr.out index 0cadfac..2a7af0c 100644 --- a/unit_tests/regression.suite/declaration-chain-dcr.out +++ b/unit_tests/regression.suite/declaration-chain-dcr.out @@ -2,6 +2,9 @@ default { state_entry() { - llOwnerSay("x" + "3"); + integer b = 3; + integer c = b; + integer d = c; + llOwnerSay("x" + (string)d); } }