From aaa8d3b7f47174a97d996d93f325609498ed10ae Mon Sep 17 00:00:00 2001 From: Sei Lisa Date: Sun, 14 Jun 2015 03:36:54 +0200 Subject: [PATCH] Fix crash when a global was optimized out and another global depended on it. --- lslopt/lsloutput.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lslopt/lsloutput.py b/lslopt/lsloutput.py index 5f41f95..8dc497b 100644 --- a/lslopt/lsloutput.py +++ b/lslopt/lsloutput.py @@ -358,7 +358,9 @@ class outscript(object): if nt == 'DECL': ret = self.dent() + node['t'] + ' ' + self.FindName(node) if child: - if 'orig' in child[0]: + if 'orig' in child[0] and (child[0]['orig']['nt'] != 'IDENT' + or child[0]['orig']['name'] + in self.symtab[child[0]['orig']['scope']]): ret += ' = ' + self.OutExpr(child[0]['orig']) else: ret += ' = ' + self.OutExpr(child[0])