From c56ff589cb14e0b14a91ac4cb14f8ed4b835afa6 Mon Sep 17 00:00:00 2001 From: Marcel Keller Date: Mon, 18 Nov 2024 11:55:43 +1100 Subject: [PATCH] Fix bugs with memory accesses in nested loops. --- Compiler/types.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Compiler/types.py b/Compiler/types.py index 0104f7b0c..263aac90a 100644 --- a/Compiler/types.py +++ b/Compiler/types.py @@ -6492,7 +6492,8 @@ def __getitem__(self, index): return self.get_vector() if isinstance(index, int) and index < 0: index += self.sizes[0] - key = program.curr_block, str(index) + key = program.curr_tape, tuple( + (x, x.has_else) for x in program.curr_tape.if_states), str(index) if key not in self.sub_cache: if util.is_constant(index) and \ (index >= self.sizes[0] or index < 0):