Fix crash when a global was optimized out and another global depended on it.

This commit is contained in:
Sei Lisa 2015-06-14 03:36:54 +02:00
parent e1d0753fec
commit aaa8d3b7f4

View file

@ -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])