1.1 --- a/translator.py Sun Sep 03 00:24:29 2023 +0200
1.2 +++ b/translator.py Tue Sep 05 21:16:49 2023 +0200
1.3 @@ -1766,9 +1766,17 @@
1.4 # objects, with only floats supporting replaceable values.
1.5
1.6 if expr:
1.7 - target_ref = TrResolvedNameRef(n.name, ref, is_global=is_global,
1.8 - location=location)
1.9 - self.result_target_name = str(target_ref)
1.10 + # Prevent parameters from becoming result targets. Otherwise, they
1.11 + # may inadvertently cause the modification of the supplied object.
1.12 +
1.13 + parameters = self.importer.function_parameters.get(path)
1.14 +
1.15 + if not parameters or n.name not in parameters:
1.16 + target_ref = TrResolvedNameRef(n.name, ref, is_global=is_global,
1.17 + location=location)
1.18 + self.result_target_name = str(target_ref)
1.19 + else:
1.20 + self.result_target_name = None
1.21
1.22 # Expression processing is deferred until after any result target has
1.23 # been set.