From 7421118805997155191953874367677542369042 Mon Sep 17 00:00:00 2001 From: Scott Lagler Date: Sun, 6 Oct 2024 14:13:43 -0400 Subject: fix: BasicBlockList iteration returns a new list The culprit here is the _n class member which serves as the counter for the __next__ function. That needs to be reset when iterating through the list --- python/function.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'python/function.py') diff --git a/python/function.py b/python/function.py index c8acf287..4f01fc29 100644 --- a/python/function.py +++ b/python/function.py @@ -237,7 +237,7 @@ class BasicBlockList: return self._count.value def __iter__(self): - return self + return BasicBlockList(self._function) def __next__(self) -> 'basicblock.BasicBlock': if self._n >= len(self): -- cgit v1.3.1