diff --git a/lslopt/lsldeadcode.py b/lslopt/lsldeadcode.py index e7abf62..360a1d2 100644 --- a/lslopt/lsldeadcode.py +++ b/lslopt/lsldeadcode.py @@ -318,6 +318,15 @@ 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 + if nt == 'CONST': tcurnode = curnode.t if tcurnode in ('integer', 'string', 'key'):