# HG changeset patch # User Paul Boddie # Date 1488544873 -3600 # Node ID d1bf04436c7c078b676259f04fb291ca38daf931 # Parent 7c8a7ad8dc500f262d4deadaaa09e41ec7db8585 Produce valid empty allocation locations when allocating attributes/parameters. diff -r 7c8a7ad8dc50 -r d1bf04436c7c optimiser.py --- a/optimiser.py Fri Mar 03 13:25:11 2017 +0100 +++ b/optimiser.py Fri Mar 03 13:41:13 2017 +0100 @@ -1105,7 +1105,7 @@ # Handle empty positions. if not attrnames: - allocated.append([]) + allocated.append([None] * len(names)) continue base = None @@ -1135,7 +1135,12 @@ raise OptimiseError, "Attribute %s cannot be explicitly positioned at %d." % \ (attrname, len(allocated)) - allocated.append(base) + # Handle empty positions. + + if base: + allocated.append(base) + else: + allocated.append([None] * len(names)) # Try to allocate each attribute name in turn.