diff options
| -rw-r--r-- | miasm2/core/types.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/miasm2/core/types.py b/miasm2/core/types.py index 110321ac..4391734d 100644 --- a/miasm2/core/types.py +++ b/miasm2/core/types.py @@ -102,6 +102,7 @@ Note that some structures (e.g. MemStr or MemArray) do not have a static size and cannot be allocated automatically. """ +import itertools import logging import struct @@ -677,8 +678,8 @@ class Array(Type): idx = self._normalize_slice(idx) if len(item) != len(xrange(idx.start, idx.stop, idx.step)): raise ValueError("Mismatched lengths in slice assignment") - # TODO: izip - for i, val in zip(xrange(idx.start, idx.stop, idx.step), item): + for i, val in itertools.izip(xrange(idx.start, idx.stop, idx.step), + item): self.field_type.set(vm, addr + self.get_offset(i), val) else: idx = self._normalize_idx(idx) |