Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Polish remove_global_guarded_variable #254

Merged
merged 1 commit into from
Jul 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sot/opcode_translator/executor/opcode_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1766,14 +1766,14 @@ def FOR_ITER(self, instr):
if not isinstance(
iterator, (SequenceIterVariable, DictIterVariable)
):
self._graph.remove_global_guarded_variable(iterator)
raise BreakGraphError()
backup_iter_idx = iterator.idx
self._inline_call_for_loop(iterator, instr)
self._lasti = self.indexof(instr.jump_to)
except BreakGraphError as e:
if backup_iter_idx:
iterator.idx = backup_iter_idx
self._graph.remove_global_guarded_variable(iterator)
self._break_graph_in_for_loop(iterator, instr)
return Stop()

Expand Down