From bcb84fcc2683e7706094c67ab5de21ba8bb903b9 Mon Sep 17 00:00:00 2001 From: Fabrice Desclaux Date: Fri, 9 Sep 2016 12:45:47 +0200 Subject: Jitter: Fix iterator handling --- miasm2/jitter/jitload.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'miasm2') diff --git a/miasm2/jitter/jitload.py b/miasm2/jitter/jitload.py index e28c6765..b2416fd5 100644 --- a/miasm2/jitter/jitload.py +++ b/miasm2/jitter/jitload.py @@ -326,7 +326,11 @@ class jitter: exception_flag = self.get_exception() for res in self.exceptions_handler(exception_flag, self): if res is not True: - yield res + if isinstance(res, collections.Iterator): + for tmp in res: + yield tmp + else: + yield res # If a callback changed pc, re call every callback if old_pc != self.pc: @@ -342,7 +346,11 @@ class jitter: exception_flag = self.get_exception() for res in self.exceptions_handler(exception_flag, self): if res is not True: - yield res + if isinstance(res, collections.Iterator): + for tmp in res: + yield tmp + else: + yield res def init_run(self, pc): """Create an iterator on pc with runiter. -- cgit 1.4.1