# HG changeset patch # User Paul Boddie # Date 1716152213 -7200 # Node ID d62de545458a2d0b95ef44cec58745dd81391f18 # Parent 189558cc45e12d3043e16b0ba4bf4703846ccea2# Parent 2df62f615d0c765f0e863b16e7b3465b2f069624 Merged changes from the value-replacement branch. diff -r 189558cc45e1 -r d62de545458a translator.py --- a/translator.py Sun May 19 22:19:37 2024 +0200 +++ b/translator.py Sun May 19 22:56:53 2024 +0200 @@ -3,7 +3,7 @@ """ Translate programs. -Copyright (C) 2015, 2016, 2017, 2018, 2023 Paul Boddie +Copyright (C) 2015-2018, 2023, 2024 Paul Boddie This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -2285,19 +2285,19 @@ # Provide space for the recorded number of temporary variables. - if self.uses_temp(name, "__tmp_targets"): + if self.uses_temp(name, "__tmp_targets") and self.max_function_target: self.writeline("__attr __tmp_targets[%d];" % self.max_function_target) - if self.uses_temp(name, "__tmp_contexts"): + if self.uses_temp(name, "__tmp_contexts") and self.max_context_index: self.writeline("__attr __tmp_contexts[%d];" % self.max_context_index) - if self.uses_temp(name, "__tmp_values"): + if self.uses_temp(name, "__tmp_values") and self.max_accessor_index: self.writeline("__attr __tmp_values[%d];" % self.max_accessor_index) - if self.uses_temp(name, "__tmp_attr_refs"): + if self.uses_temp(name, "__tmp_attr_refs") and self.max_attribute_ref_index: self.writeline("__attr *__tmp_attr_refs[%d];" % self.max_attribute_ref_index) - if self.uses_temp(name, "__tmp_results"): + if self.uses_temp(name, "__tmp_results") and self.max_result_target: self.writeline("__attr __tmp_results[%d] = {0};" % self.max_result_target) if self.uses_temp(name, "__tmp_private_context"):