# HG changeset patch # User Paul Boddie # Date 1489165027 -3600 # Node ID 6b790fb0924e93dc7d46161e83a066075deb8a38 # Parent 85416087aa62d23e139ed11ed8d871eafbb4eeb6 Uphold positioning conflicts only if the existing locations were explicitly specified. Otherwise, reposition attributes, causing the program to be regenerated, if it was only previously-generated attribute position data being used when a conflict occurred. diff -r 85416087aa62 -r 6b790fb0924e optimiser.py --- a/optimiser.py Fri Mar 10 17:26:58 2017 +0100 +++ b/optimiser.py Fri Mar 10 17:57:07 2017 +0100 @@ -435,8 +435,22 @@ attrnames = filter(lambda x: not x.startswith("$t"), attrnames) self.all_attrs[(objkind, name)] = attrnames - self.locations = get_allocated_locations(self.all_attrs, - get_attributes_and_sizes, self.existing_locations) + try: + self.locations = get_allocated_locations(self.all_attrs, + get_attributes_and_sizes, self.existing_locations) + + # Uphold positioning conflicts only if the existing locations were + # explicitly specified. + + except OptimiseError: + if self.locations_filename: + raise + + # Otherwise, reposition attributes, causing the program to be + # regenerated. + + self.locations = get_allocated_locations(self.all_attrs, + get_attributes_and_sizes) def populate_parameters(self):