# HG changeset patch # User Paul Boddie # Date 1491249606 -7200 # Node ID 510e76aa07f294921e3d369d6c1c35581ba5b36a # Parent 6097bc0ef5ec4e08adf70187afd5ae79721c9860 Reposition parameters that are not explicitly specified if necessary. diff -r 6097bc0ef5ec -r 510e76aa07f2 optimiser.py --- a/optimiser.py Mon Apr 03 02:24:46 2017 +0200 +++ b/optimiser.py Mon Apr 03 22:00:06 2017 +0200 @@ -458,9 +458,23 @@ # Allocate positions from 1 onwards, ignoring the context argument. - self.arg_locations = [set()] + get_allocated_locations( - self.importer.function_parameters, get_parameters_and_sizes, - self.existing_arg_locations[1:]) + try: + self.arg_locations = [set()] + get_allocated_locations( + self.importer.function_parameters, get_parameters_and_sizes, + self.existing_arg_locations[1:]) + + # Uphold positioning conflicts only if the existing locations were + # explicitly specified. + + except OptimiseError: + if self.parameter_locations_filename: + raise + + # Otherwise, reposition parameters, causing the program to be + # regenerated. + + self.arg_locations = [set()] + get_allocated_locations( + self.importer.function_parameters, get_parameters_and_sizes) def position_attributes(self):