# HG changeset patch # User Paul Boddie # Date 1479593752 -3600 # Node ID cbca47e004fe55b782101d880e15d0e092f2717b # Parent 6f1e5a97277c4d5eb8fd1d31222a1e412b243a08 Make sure that structures are generated for functions whose names are reused and whose program locations therefore yield variable references. diff -r 6f1e5a97277c -r cbca47e004fe generator.py --- a/generator.py Sat Nov 19 18:38:27 2016 +0100 +++ b/generator.py Sat Nov 19 23:15:52 2016 +0100 @@ -256,16 +256,16 @@ # Generate function instances. - functions = set() - - for ref in self.importer.objects.values(): - if ref.has_kind(""): - functions.add(ref.get_origin()) - - functions = list(functions) + functions = self.importer.function_parameters.keys() functions.sort() for path in functions: + + # Instantiators are generated above. + + if self.importer.classes.has_key(path) or not self.importer.get_object(path): + continue + cls = self.function_type table_name = encode_tablename("", cls) structure_size = encode_size("", cls) @@ -277,8 +277,8 @@ # Produce two structures where a method is involved. - ref = self.importer.get_object(path) - parent_ref = self.importer.get_object(ref.parent()) + parent, name = path.rsplit(".", 1) + parent_ref = self.importer.get_object(parent) parent_kind = parent_ref and parent_ref.get_kind() # Populate and write each structure.