Skip to content

Commit

Permalink
Fix bugs with memory accesses in nested loops.
Browse files Browse the repository at this point in the history
  • Loading branch information
mkskeller committed Nov 18, 2024
1 parent 94b8c33 commit c56ff58
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Compiler/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit c56ff58

Please sign in to comment.