1.1 --- a/generator.py Tue Dec 06 22:58:16 2016 +0100
1.2 +++ b/generator.py Wed Dec 07 01:05:36 2016 +0100
1.3 @@ -833,13 +833,13 @@
1.4
1.5 # References to constant literals.
1.6
1.7 - if kind == "<instance>":
1.8 - attr_path = "%s.%s" % (path, name)
1.9 + if kind == "<instance>" and ref.is_constant_alias():
1.10 + alias = ref.get_name()
1.11
1.12 # Obtain a constant value directly assigned to the attribute.
1.13
1.14 - if self.optimiser.constant_numbers.has_key(attr_path):
1.15 - constant_number = self.optimiser.constant_numbers[attr_path]
1.16 + if self.optimiser.constant_numbers.has_key(alias):
1.17 + constant_number = self.optimiser.constant_numbers[alias]
1.18 constant_value = "__const%d" % constant_number
1.19 return "%s /* %s */" % (constant_value, name)
1.20